Doctrine\ODM\OrientDB\Mapper\Hydration\Hydrator::hydrateCollection PHP Method

hydrateCollection() public method

Hydrates an array of documents.
public hydrateCollection ( array $collection ) : Doctrine\ODM\OrientDB\Collections\ArrayCollection
$collection array
return Doctrine\ODM\OrientDB\Collections\ArrayCollection
    public function hydrateCollection(array $collection)
    {
        $records = array();
        foreach ($collection as $key => $record) {
            if ($record instanceof \stdClass) {
                $records[$key] = $this->hydrate($record);
            } else {
                $records[$key] = $this->hydrateRid(new Rid($record));
            }
        }
        return new ArrayCollection($records);
    }