Exemplo n.º 1
0
 /**
  * Gets the related EntityManager.
  *
  * @return EntityManager
  */
 public static function getManager()
 {
     static $manager;
     if (!$manager) {
         $manager = EntityManager::getInstance();
     }
     return $manager;
 }
Exemplo n.º 2
0
 /**
  * Resolve additional relations
  *
  * @param QueryBuilder $query
  * @param array        $targets
  */
 protected function resolveRelations(QueryBuilder $query, $targets)
 {
     if (!$targets) {
         return;
     }
     foreach ($query->getRelations() as $name => $q) {
         $this->manager->related($targets, $name, $q);
     }
 }