Hi,
how can i set an array to the find function? The parameter $wantedUsersId, is an array of id's -> 1,2,3,4,5,....
$users = Users::find($wantedUsersId);
Thx
Stefan
I think it's supported since 2.0.4
https://blog.phalcon.io/post/phalcon-2-0-4-released
https://docs.phalcon.io/en/latest/reference/models.html
$wantedUsersId = [[0] => 35, [2] => 78]; //keys must be numbered from zero: $users = Users::find( array( 'id IN ({ids:array})', 'bind' => array( 'ids' => $wantedUsersId ) ) );
Hello Jimmy,
Yes it works :-))
This also works:
$users = Users::query() ->inWhere('id', $blackbookUsersId) ->execute();
Rgds