We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Model can't be loaded

Hi,

When I write a query request with where condition, I got the following message : Contact::query()->where('isActive=1');

Model 'Contact' could not be loaded
#0 [internal function]: Phalcon\Mvc\Model\Manager->load('Contact', true)
#1 [internal function]: Phalcon\Mvc\Model\Query->_prepareSelect()
#2 [internal function]: Phalcon\Mvc\Model\Query->parse()
#3 app/library/Sforce/adapter/Sforce.php(262): Phalcon\Mvc\Model\Query->execute()

however if I do Contact::query()->execute() and get all contacts. I then have a good result. Contact object are outputed.

Any suggestion?

Regards

try Contact::query()->where('isActive=1')->execute()

add the execute on end of it

Hello,

That what I meant, it doesn't work.

Still a issue. I also get sometimes. On automatique request like select à field that belongTo : "Scanner: Unknown opcode 58"

en générale, ça c'est lorsqu'il y a une limite d'indiquée. 'SELECT..... LIMIT ?"

Regards

try :

Contact::query()
->columns([
"\NAMESPACE\Models\Contact.isActive"
])
->where('isActive=1')
->execute()