예제 #1
0
파일: Users.php 프로젝트: erdiko/doctrine
 public function getUsersOld()
 {
     // The old fashioned way (typical doctrine use)
     $entityManager = \erdiko\doctrine\EntityManager::getEntityManager();
     return $entityManager->getRepository('app\\entities\\User')->findAll();
 }
예제 #2
0
 /**
  * getRepository
  *
  * @param string $entityName, the name of the entity
  * @param string $db, name of the db to connect to
  * @return \Doctrine\ORM\EntityRepository The repository class
  */
 public function getRepository($entityName, $db = null)
 {
     return \erdiko\doctrine\EntityManager::getEntityManager()->getRepository($entityName);
 }