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 FETCH_ASSOC = 1; // Should be 2 const FETCH_BOTH = 2; // Should be 4 const FETCH_NUM = 3; // It is ok const FETCH_OBJ = 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::FETCH_OBJ with 5 or \PDO::FETCH_OBJ, it works as expected.