Exemplo n.º 1
0
 /**
  * Deduce the relationships that will be lazy loaded from the eagerLoads array
  *
  * @return array
  */
 protected function prepareLazyLoading()
 {
     $entityMap = $this->entityMap;
     if (!$entityMap->relationsParsed()) {
         $initializer = new MapInitializer($entityMap);
         $initializer->splitRelationsTypes($this->mapper->newInstance());
     }
     $singleRelations = $entityMap->getSingleRelationships();
     $manyRelations = $entityMap->getManyRelationships();
     $allRelations = array_merge($manyRelations, $singleRelations);
     return array_diff($allRelations, $this->eagerLoads);
 }
Exemplo n.º 2
0
 /**
  * Get a new instance for the entity
  * 
  * @param  array  $attributes 
  * @return Entity
  */
 public function getEntityInstance(array $attributes = array())
 {
     return $this->mapper->newInstance($attributes);
 }