-
Notifications
You must be signed in to change notification settings - Fork 8
Description
Hi got the following error
PHP Fatal error: Uncaught exception 'Phalcon\Mvc\Model\Exception' with message 'A dependency injector container is required to obtain the services related to the ORM' in phalcon/mvc/model/manager.zep:406\nStack trace:\n#0 [internal function]: Phalcon\Mvc\Model\Manager->_getConnection(Object(Library\App\Models\Product), NULL)\n#1 [internal function]: Phalcon\Mvc\Model\Manager->getReadConnection(Object(Library\App\Models\Product))\n#2 [internal function]: Phalcon\Mvc\Model->getReadConnection()\n#3 [internal function]: Phalcon\Mvc\Model\MetaData\Strategy\Introspection->getMetaData(Object(Library\App\Models\Product), Object(Phalcon\Di\FactoryDefault))\n#4 [internal function]: Phalcon\Mvc\Model\MetaData->_initialize(Object(Library\App\Models\Product), 'library\app\mod...', 'product', '')\n#5 [internal function]: Phalcon\Mvc\Model\MetaData->readMetaDataIndex(Object(Library\App\Models\Product), 0)\n#6 /var/www/html/anaohApi/vendor/stanislav-web/phalcon-searcher/src/Searcher/Validator.php(325): Phalcon\Mvc\Model\MetaData->getAttributes(Objec in phalcon/mvc/model/manager.zep on line 406, referer: http://192.168.43.148:3000/
my function
$query = $this->request->getQuery('q', 'string');
// create object instance
$searcher = new Searcher();
$searcher->setFields([
'Library\App\Models\Product' => [
'title',
'summary',
],
'Library\App\Models\Jobs' => [
'title',
'description'
]
])
->setQuery($query);
$result = $searcher->run();