getMetadataCacheImpl() public method

Gets the cache driver implementation that is used for metadata caching.
public getMetadataCacheImpl ( ) : Doctrine\Common\Cache\Cache
return Doctrine\Common\Cache\Cache
Example #1
0
 /**
  * Creates a new XmlEntityManager that uses the given Configuration and EventManager implementations.
  *
  * @param Storage $storage
  * @param Configuration $config
  * @param \Doctrine\Common\EventManager $eventManager
  */
 public function __construct(Storage $storage, Configuration $config, EventManager $eventManager = null)
 {
     $this->storage = $storage;
     $this->config = $config;
     if (null === $eventManager) {
         $eventManager = new EventManager();
     }
     $this->eventManager = $eventManager;
     $metadataFactoryClassName = $config->getClassMetadataFactoryName();
     $this->metadataFactory = new $metadataFactoryClassName($config, $this->eventManager);
     $this->metadataFactory->setCacheDriver($this->config->getMetadataCacheImpl());
     $marshallerClassName = $config->getMarshallerClassName();
     $this->marshaller = new $marshallerClassName($this->metadataFactory);
     $this->unitOfWork = new UnitOfWork($this);
 }
 /**
  * @param Configuration $configuration
  * @param EventManager|null $evm
  * @return null
  */
 public function __construct(Configuration $configuration, EventManager $evm = null)
 {
     $this->configuration = $configuration;
     $this->evm = $evm;
     $this->setCacheDriver($this->configuration->getMetadataCacheImpl());
     // Private property of parent class
 }
 /**
  * Lazy initialization of this stuff, especially the metadata driver,
  * since these are not needed at all when a metadata cache is active.
  */
 private function initialize()
 {
     $this->cacheDriver = $this->configuration->getMetadataCacheImpl();
     $this->driver = $this->configuration->getMetadataDriverImpl();
     if (null === $this->evm) {
         $this->evm = new EventManager();
     }
     $this->initialized = true;
 }