Beispiel #1
0
 /**
  * Build lazy loading proxies for the current entity
  *
  * @param \Analogue\ORM\Mappable $entity
  *
  * @return array
  */
 protected function getLazyLoadingProxies(Mappable $entity)
 {
     $proxies = [];
     $singleRelations = $this->entityMap->getSingleRelationships();
     $manyRelations = $this->entityMap->getManyRelationships();
     foreach ($this->lazyLoads as $relation) {
         if (in_array($relation, $singleRelations)) {
             $proxies[$relation] = new EntityProxy($entity, $relation);
         }
         if (in_array($relation, $manyRelations)) {
             $proxies[$relation] = new CollectionProxy($entity, $relation);
         }
     }
     return $proxies;
 }