Example #1
0
 /**
  * @return EntityManagerInterface
  */
 public function getEntityManager()
 {
     if (null === $this->entityManager) {
         $doctrine = new Doctrine();
         $doctrine->setConfig($this->config);
         $this->entityManager = $doctrine->getEntityManager();
     }
     return $this->entityManager;
 }
 public function setUp()
 {
     $doctrine = new Doctrine();
     $doctrine->setConfig((new Config(['host' => getenv('MYSQL_HOST'), 'port' => getenv('MYSQL_PORT'), 'dbname' => getenv('MYSQL_DATABASE'), 'user' => getenv('MYSQL_USER'), 'password' => getenv('MYSQL_PASSWORD')]))->setIsDev(true));
     $this->em = $doctrine->getEntityManager();
 }
Example #3
0
 public function __construct(Config $config)
 {
     $this->doctrine = new Doctrine();
     $this->doctrine->setConfig($config);
 }