public function createEntityManagerMock(\Psc\Doctrine\Module $module = NULL, $con = NULL) { if (isset($module)) { if (!isset($con)) { $con = $module->getConnectionName(); } $evm = new \Doctrine\Common\EventManager(); $config = $module->getConfiguration(); $conn = \Doctrine\DBAL\DriverManager::getConnection($module->getConnectionOptions($con), $config, $evm); return new \Psc\Doctrine\Mocks\EntityManager($conn, $config, $evm); } else { return new \Psc\Doctrine\Mocks\EntityManager(); } }
/** * @return Psc\CMS\EntityMeta */ public function getEntityMeta($entityName, \Psc\Doctrine\Module $module = NULL) { if (!isset($module)) { if (isset($this->dc)) { return $this->dc->getEntityMeta($entityName); } else { return $this->getModule('Doctrine')->getEntityMeta($entityName); } } return $module->getEntityMeta($entityName); }