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

Namespaces problem

Hello, I'm a newbie with the powerful Phalcon, I try to make an admins interface but I get this error

Fatal error: Class 'Weblev\Models\Phalcon\Db' not found in /home/weblev/www/app/models/Machines.php on line 74

The line 74 contain

$resultset->setFetchMode(Phalcon\Db::FETCH_OBJ);

The code worked perfectly before I try to do an admin Interface and use a namespace



8.1k
Accepted
answer
$resultset->setFetchMode(\Phalcon\Db::FETCH_OBJ);

https://php.net/manual/en/language.namespaces.fallback.php

I tried this solution but I gess I've messed somewhere, I gonna check.

Thank you