Exemplo n.º 1
0
 /**
  * @{inheritDoc}
  */
 public function getIterator()
 {
     if ($this->queryBuilder) {
         return new CollectionMapIterator($this->queryBuilder->getQuery()->iterate(), function ($row) {
             $entity = $row[0];
             if ($this->detaching) {
                 $this->queryBuilder->getEntityManager()->detach($entity);
             }
             return $entity;
         });
     } else {
         return parent::getIterator();
     }
 }