コード例 #1
0
ファイル: CacheConfiguration.php プロジェクト: naldz/cyberden
 /**
  * @return \Doctrine\ORM\Cache\QueryCacheValidator
  */
 public function getQueryValidator()
 {
     if ($this->queryValidator === null) {
         $this->queryValidator = new TimestampQueryCacheValidator($this->cacheFactory->getTimestampRegion());
     }
     return $this->queryValidator;
 }
コード例 #2
0
ファイル: DefaultCache.php プロジェクト: Dren-x/mobitnew
 /**
  * {@inheritdoc}
  */
 public function getQueryCache($regionName = null)
 {
     if ($regionName === null) {
         return $this->defaultQueryCache ?: ($this->defaultQueryCache = $this->cacheFactory->buildQueryCache($this->em));
     }
     if (!isset($this->queryCaches[$regionName])) {
         $this->queryCaches[$regionName] = $this->cacheFactory->buildQueryCache($this->em, $regionName);
     }
     return $this->queryCaches[$regionName];
 }
コード例 #3
0
 /**
  * @expectedException InvalidArgumentException
  * @expectedExceptionMessage Unrecognized access strategy type [-1]
  */
 public function testBuildCachedCollectionPersisterException()
 {
     $em = $this->em;
     $entityName = 'Doctrine\\Tests\\Models\\Cache\\State';
     $metadata = $em->getClassMetadata($entityName);
     $mapping = $metadata->associationMappings['cities'];
     $persister = new OneToManyPersister($em);
     $mapping['cache']['usage'] = -1;
     $this->factory->buildCachedCollectionPersister($em, $persister, $mapping);
 }