Hello all.
I have this code:
$users = \Qello\Mvc\Model\Users\Users::find(array('limit' => array('number' => $this->usersPage, 'offset' => $page * $this->usersPage)));
foreach ($users as $val) {
$user = $val->toArray();
$user['profiles'] = $this->getProfiles($user['id']);
.
.
}
private function getProfiles($id) {
$profiles = \Qello\Mvc\Model\Users\UserProfiles::find('user_id = '.$id);
.
.
return profileList
}
I have in the users table 5k records. When i run my script PHP says "Out of memory".
When I change getProfiles function like this:
private function getProfiles($id) {
$profiles = \Qello\Mvc\Model\Users\UserProfiles::query()->where('user_id = :user_id:')->bind(array('user_id' => $id))->execute();
.
.
return profileList
}
all works fine.
Do I have something wrong in my first script or this is a bug.
Thanks in advance.