本文整理汇总了PHP中Kdyby\Doctrine\EntityManager::getConfiguration方法的典型用法代码示例。如果您正苦于以下问题:PHP EntityManager::getConfiguration方法的具体用法?PHP EntityManager::getConfiguration怎么用?PHP EntityManager::getConfiguration使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Kdyby\Doctrine\EntityManager
的用法示例。
在下文中一共展示了EntityManager::getConfiguration方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: invalidate
public function invalidate()
{
$ormConfig = $this->entityManager->getConfiguration();
$dbalConfig = $this->entityManager->getConnection()->getConfiguration();
$cache = array($ormConfig->getHydrationCacheImpl(), $ormConfig->getMetadataCacheImpl(), $ormConfig->getQueryCacheImpl(), $ormConfig->getResultCacheImpl(), $dbalConfig->getResultCacheImpl());
foreach ($cache as $impl) {
if (!$impl instanceof CacheProvider) {
continue;
}
$impl->deleteAll();
}
}
示例2: invalidate
public function invalidate()
{
$ormConfig = $this->entityManager->getConfiguration();
$dbalConfig = $this->entityManager->getConnection()->getConfiguration();
$cache = $this->cacheStorages;
$cache[] = $ormConfig->getHydrationCacheImpl();
$cache[] = $ormConfig->getMetadataCacheImpl();
$cache[] = $ormConfig->getQueryCacheImpl();
$cache[] = $ormConfig->getResultCacheImpl();
$cache[] = $dbalConfig->getResultCacheImpl();
foreach ($cache as $impl) {
if (!$impl instanceof ClearableCache) {
continue;
}
$impl->deleteAll();
}
}
示例3: __construct
/**
* @param EntityManager $em
*/
public function __construct(EntityManager $em)
{
$this->em = $em;
$this->db = $em->getConnection();
$this->platform = $this->db->getDatabasePlatform();
$this->quotes = $em->getConfiguration()->getQuoteStrategy();
$this->uow = $this->em->getUnitOfWork();
}
示例4: __construct
/**
* @param EntityManager $entityManager
* @param string $repositoryName
*/
public function __construct(EntityManager $entityManager, $repositoryName)
{
$entityManager->getConfiguration()->addCustomNumericFunction("greatest", 'App\\Doctrine\\Greatest');
$entityManager->getConfiguration()->addCustomNumericFunction("least", 'App\\Doctrine\\Least');
$entityManager->getConfiguration()->addCustomNumericFunction("rand", 'App\\Doctrine\\Rand');
$entityManager->getConfiguration()->addCustomNumericFunction("countif", 'App\\Doctrine\\CountIf');
$entityManager->getConfiguration()->addCustomNumericFunction("round", 'App\\Doctrine\\Round');
$entityManager->getConfiguration()->addCustomNumericFunction("date", 'App\\Doctrine\\Date');
$this->entityManager = $entityManager;
$this->repositoryName = $repositoryName;
}
示例5: indexEntities
public function indexEntities(ClassMetadata $searchMeta)
{
foreach ($this->searchManager->getMetadataFactory()->getAllMetadata() as $otherMeta) {
if ($searchMeta->className === $otherMeta->className) {
continue;
}
if (is_subclass_of($searchMeta->className, $otherMeta->className)) {
$this->onChildSkipped($this, $searchMeta, $otherMeta);
return;
}
}
if ($searchMeta->riverImplementation) {
$river = $this->serviceLocator->getByType($searchMeta->riverImplementation);
} else {
/** @var River\DefaultEntityRiver $river */
$river = $this->serviceLocator->createInstance('Kdyby\\DoctrineSearch\\River\\DefaultEntityRiver');
}
if (!$river instanceof EntityRiver) {
throw new UnexpectedValueException('The river must implement Doctrine\\Search\\EntityRiver.');
}
if (property_exists($river, 'onIndexStart')) {
$river->onIndexStart[] = function (EntityRiver $river, $paginator, ORMMetadata $class) {
$this->onIndexStart($this, $paginator, $river, $class);
};
}
if (property_exists($river, 'onItemsIndexed')) {
$river->onItemsIndexed[] = function ($self, $entities) {
$this->onItemsIndexed($this, $entities);
};
}
if (property_exists($river, 'onIndexStats')) {
$river->onIndexStats[] = function ($self, ORMMetadata $class, $timeToIndex, $timeToRead) {
$this->onIndexStats($this, $class, $timeToIndex, $timeToRead);
};
}
// disable logger
$config = $this->entityManager->getConfiguration();
$oldLogger = $config->getSQLLogger();
$config->setSQLLogger(NULL);
$river->transfuse($searchMeta);
$config->setSQLLogger($oldLogger);
}
示例6: removeCacheTag
public function removeCacheTag($tag)
{
$this->em->getConfiguration()->getResultCacheImpl()->delete($tag);
}
示例7: addFunctions
private function addFunctions()
{
$emConfig = $this->entityManager->getConfiguration();
$emConfig->addCustomNumericFunction('RAND', 'DoctrineExtensions\\Query\\Mysql\\Rand');
}