I don't know if it's a bug, but since you use the PDO layer, the constants for fetching records, should have the same value as in PDO.
For example, now you have:
const FETCHASSOC = 1; // Should be 2 const FETCHBOTH = 2; // Should be 4 const FETCHNUM = 3; // It is ok const FETCHOBJ = 4; // Should be 5 as in PDO
If you don't correct this, running the following code, will not return the records as expected (object)
$db = $this->getDI()->get('db')->getInternalHandler(); $result = $db->query($s_query); $result->setFetchMode(\Phalcon\Db::FETCH_OBJ); return $result->fetchAll();
But if you replace \Phalcon\Db::FETCHOBJ with 5 or \PDO::FETCHOBJ, it works as expected.