Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

How to store data obtained from db using find() method in multi-dimensional array.

I obtained some data from db using find() method... the data contains 2 rows named "controllers " and "actions" i want to pass this data in a 2-D array....i got stuck in the loop itself How to do it??? Please help!!!!

$check = AccessRole::find("role_id=1");
$count = count($check); // for my data....numbers rows obtained is 57
$resources = array(); // 2-d Array where i want to pass the data...

for ($i = 0; $i < $count; $i++) {


@jaikumar002 Could you please explain a bit more.

edited Dec '16


isn't toArray() what you are looking for ?

$resource = $check->toArray();

see method toArray()

Also, could do the trick


phalcon is really good ;-))