When I use Model::find() response is Resultset of Models, but when I add columns parameter to restrict returned columns the response is Resultset of Rows.
Example:
// Resultset of Models
$users = \Models\Users\Users::find();
// Resultset of Rows
$users = \Models\Users\Users::find([
'columns' => 'id, email'
]);
That makes me unable to call model methods. Is there a way to have Resultset of Models with columns restriction in ::find() method? I'm not sure, but this seems like bug, since Phalcon docs says:
While findFirst() returns directly an instance of the called class (when there is data to be returned), the find() method returns a Phalcon\Mvc\Model\Resultset\Simple.
And there is nothing about the exception of this rule when using columns parameter.
I would also note that other parameters of ::find() like condition, order, bind etc. works fine (Models returned).
Phalcon 1.3.4
Resultset of Rowsbecause Phalcon is unable to return your completeUsersModel structure, therefor it wont be "recognized" as aUsersobject. - Timothy