예제 #1
0
 /**
  * @return \Doctrine\ORM\Cache\QueryCacheValidator
  */
 public function getQueryValidator()
 {
     if ($this->queryValidator === null) {
         $this->queryValidator = new TimestampQueryCacheValidator($this->cacheFactory->getTimestampRegion());
     }
     return $this->queryValidator;
 }
예제 #2
0
 /**
  * {@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];
 }
 /**
  * @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);
 }