Hello folk! I'm trying to run a PHQL
from an external class, but I got the following error:
A dependency injection object is required to access ORM services
This is my code:
$modelsManager = new Manager();
$res = $modelsManager->executeQuery(
$phql,
[
'name' => $name,
'age' => $age,
'color' => $color
]
);
At the top, I have included this:
use Phalcon\Di;
use Phalcon\Mvc\Model\Manager;
What is wrong? Must I use Micro
? I don't know how to make it work.
Related thread: https://forum.phalcon.io/discussion/877/error-message-when-using-integer-filter-in-getquery-function-of-