/** * Checks whether the translations table exists in the database * * @return bool */ protected function checkDatabase() { if (null === $this->dbCheck) { $this->dbCheck = SafeDatabaseChecker::tablesExist($this->getEntityManager()->getConnection(), SafeDatabaseChecker::getTableName($this->doctrine, Translation::ENTITY_NAME)); } return $this->dbCheck; }
/** * Check if user table exists in db * * @return bool */ protected function checkDatabase() { $className = $this->getOwnershipMetadataProvider()->getBasicLevelClass(); return SafeDatabaseChecker::tablesExist($this->getManagerForClass($className)->getConnection(), SafeDatabaseChecker::getTableName($this->getContainer()->get('doctrine'), $className)); }
/** * @expectedException \Exception * @expectedExceptionMessage unexpected */ public function testGetTableNameShouldRethrowUnexpectedException() { $doctrine = $this->getMock('Doctrine\\Common\\Persistence\\ManagerRegistry'); $doctrine->expects($this->once())->method('getManagerForClass')->willThrowException(new \Exception('unexpected')); SafeDatabaseChecker::getTableName($doctrine, 'Test\\Entity'); }
/** * Checks whether the translations table exists in the database * * @return bool */ protected function checkDatabase() { if (null === $this->dbCheck) { $doctrine = $this->container->get('doctrine'); $this->dbCheck = SafeDatabaseChecker::tablesExist($doctrine->getManagerForClass(Translation::ENTITY_NAME)->getConnection(), SafeDatabaseChecker::getTableName($doctrine, Translation::ENTITY_NAME)); } return $this->dbCheck; }