loadCollection() public method

Initializes (loads) an uninitialized persistent collection of an entity.
public loadCollection ( Doctrine\ORM\PersistentCollection $collection )
$collection Doctrine\ORM\PersistentCollection The collection to initialize.
Example #1
0
 /**
  * @param PersistentCollection $collection
  */
 public function loadCollection(PersistentCollection $collection)
 {
     parent::loadCollection($collection);
     $em = $this->getParentEntityManager();
     foreach ($collection->toArray() as $element) {
         $postLazyloadEventArgs = new PostLazyLoadEventArgs($em, $element);
         $em->getEventManager()->dispatchEvent(PostLazyLoadEventArgs::EVENT_NAME, $postLazyloadEventArgs);
     }
 }