Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function handle(ResponseInterface $response)
 {
     $class = get_class($this->model);
     $model = new $class();
     $model->jsonUnserialize($response->getBody());
     $response->setModel($model);
 }
 /**
  * {@inheritdoc}
  */
 public function handle(ResponseInterface $response)
 {
     $collection = array();
     $class = get_class($this->model);
     $objects = json_decode($response->getBody());
     foreach ($objects as $object) {
         $model = new $class();
         $model->update($object);
         $collection[] = $model;
     }
     $response->setCollection($collection);
 }