From d9e396078713ad2d8d343a2ac8cd4baf3447ea52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=9F=D0=B0?= =?UTF-8?q?=D1=86=D1=83=D1=80=D0=B0?= Date: Sat, 16 Aug 2014 17:12:47 +0400 Subject: [PATCH] Rewrite method for hydrateCollection with , --- src/Client.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Client.php b/src/Client.php index c37f18d..80073c3 100755 --- a/src/Client.php +++ b/src/Client.php @@ -170,7 +170,7 @@ public function getUsers(array $ids) 'uids' => $ids )); - return $this->hydrateUsersCollection($apiResult); + return $this->hydrateCollection($apiResult, $this->getHydrator(), new Entity\User()); } /** @@ -189,15 +189,17 @@ public function getFriendsList($id = null) /** * @param $apiResult + * @param $hydrator + * @param $instance * @return array|bool */ - protected function hydrateUsersCollection($apiResult) + protected function hydrateCollection($apiResult, $hydrator, $instance) { if ($apiResult && is_array($apiResult)) { $result = array(); foreach ($apiResult as $row) { - $result[] = $this->getHydrator()->hydrate(new Entity\User(), $result); + $result[] = $hydrator->hydrate($instance, $result); } return $result;