/** * @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(); }
public function __construct(Config $config) { $this->doctrine = new Doctrine(); $this->doctrine->setConfig($config); }