protected function hydrateCollection($data) { $stack = $this->provider->getDefinition()->getEntityCollection(); foreach ($data as $key => $value) { $stack->push($this->hydrateEntity($value)); } $stack->rewind(); return $stack; }