当前位置: 首页>>代码示例>>PHP>>正文


PHP EntityManager::getConfiguration方法代码示例

本文整理汇总了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();
     }
 }
开发者ID:peterkrejci,项目名称:music-collection,代码行数:12,代码来源:CacheCleaner.php

示例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();
     }
 }
开发者ID:richard-ejem,项目名称:Doctrine,代码行数:17,代码来源:CacheCleaner.php

示例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();
 }
开发者ID:peterkrejci,项目名称:music-collection,代码行数:11,代码来源:NonLockingUniqueInserter.php

示例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;
 }
开发者ID:bares43,项目名称:bachelor-thesis-survey,代码行数:15,代码来源:Database.php

示例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);
 }
开发者ID:rohlikcz,项目名称:DoctrineSearch,代码行数:42,代码来源:EntityPiper.php

示例6: removeCacheTag

 public function removeCacheTag($tag)
 {
     $this->em->getConfiguration()->getResultCacheImpl()->delete($tag);
 }
开发者ID:chapcz,项目名称:sandbox,代码行数:4,代码来源:BaseFacade.php

示例7: addFunctions

 private function addFunctions()
 {
     $emConfig = $this->entityManager->getConfiguration();
     $emConfig->addCustomNumericFunction('RAND', 'DoctrineExtensions\\Query\\Mysql\\Rand');
 }
开发者ID:ParalelniPolis,项目名称:bitcoinJukebox,代码行数:5,代码来源:SongsManager.php


注:本文中的Kdyby\Doctrine\EntityManager::getConfiguration方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。