Model could not be loaded while executing query [Phalcon Framework]

i get some trouble when using model query for execute in phalcon framework like this sample and the result :

$query = new Query(
“SELECT * FROM Campaign”,
$this->getDI()
);

Model ‘Campaign’ could not be loaded
#0 [internal function]: Phalcon\Mvc\Model\Manager->load(‘Campaign’, true)
#1 [internal function]: Phalcon\Mvc\Model\Query->_prepareSelect()
#2 [internal function]: Phalcon\Mvc\Model\Query->parse()
#3 /var/www/html/gamanads/app/controllers/AdspaceController.php(185): Phalcon\Mvc\Model\Query->execute()
#4 [internal function]: Vokuro\Controllers\AdspaceController->offerwallAction()
#5 [internal function]: Phalcon\Dispatcher->callActionMethod(Object(Vokuro\Controllers\AdspaceController), ‘offerwallAction’, Array)
#6 [internal function]: Phalcon\Dispatcher->_dispatch()
#7 [internal function]: Phalcon\Dispatcher->dispatch()
#8 /var/www/html/gamanads/public/index.php(41): Phalcon\Mvc\Application->handle()
#9 {main}

how i solve this problem is just, get full path for the model in models folder like this.

$query = new Query(
“SELECT * FROM Vokuro\Models\Campaign”,
$this->getDI()
);

and, taraaaaaa…. works very well.

thankyou.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s