I have a working phalcon application. I moved it from windows to linux server everything works proper. But when i want to use phalcon model findby resultset it returns different result. I use Phalcon 2.0.13
$userRoles = UserRoles::findByUserId($userId);
var_dump($userRoles->count()); //Returns -1
var_dump(count($userRoles)); // Returns -1
var_dump(count($userRoles->toArray())); // Returns 3 and when i var_dump result result is right there are 3 records
foreach ($userRoles as $role) { //This foreach doesnt work because result length is -1
$roleArr = Auth::rolesParse($role->role_id);
$roles = array_merge_recursive($roles, $roleArr);
}
I have many samples of this code, so converting all the resultsets to array is not solution to me. I don't know is it about php extensions, configuration or phalcon configuration
(array)[Number of Elements: 3]
0:
(array)[Number of Elements: 3]
"id":
(string) 2049
"role_id":
(string) 1
"user_id":
(string) 28
1:
(array)[Number of Elements: 3]
"id":
(string) 2050
"role_id":
(string) 2
"user_id":
(string) 28
2:
(array)[Number of Elements: 3]
"id":
(string) 2051
"role_id":
(string) 3
"user_id":
(string) 28