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


PHP ClassMetadataFactory::setCacheDriver方法代码示例

本文整理汇总了PHP中Doctrine\ORM\Mapping\ClassMetadataFactory::setCacheDriver方法的典型用法代码示例。如果您正苦于以下问题:PHP ClassMetadataFactory::setCacheDriver方法的具体用法?PHP ClassMetadataFactory::setCacheDriver怎么用?PHP ClassMetadataFactory::setCacheDriver使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Doctrine\ORM\Mapping\ClassMetadataFactory的用法示例。


在下文中一共展示了ClassMetadataFactory::setCacheDriver方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * Creates a new EntityManager that operates on the given database connection
  * and uses the given Configuration and EventManager implementations.
  *
  * @param Doctrine\DBAL\Connection $conn
  * @param string $name
  * @param Doctrine\ORM\Configuration $config
  * @param Doctrine\Common\EventManager $eventManager
  */
 protected function __construct(Connection $conn, Configuration $config, EventManager $eventManager)
 {
     $this->_conn = $conn;
     $this->_config = $config;
     $this->_eventManager = $eventManager;
     $this->_metadataFactory = new ClassMetadataFactory($this->_config->getMetadataDriverImpl(), $this->_conn->getDatabasePlatform());
     $this->_metadataFactory->setCacheDriver($this->_config->getMetadataCacheImpl());
     $this->_unitOfWork = new UnitOfWork($this);
     $this->_proxyGenerator = new DynamicProxyGenerator($this, $this->_config->getCacheDir());
 }
开发者ID:jackbravo,项目名称:doctrine,代码行数:19,代码来源:EntityManager.php

示例2: __construct

 /**
  * Creates a new EntityManager that operates on the given database connection
  * and uses the given Configuration and EventManager implementations.
  *
  * @param Doctrine\DBAL\Connection $conn
  * @param Doctrine\ORM\Configuration $config
  * @param Doctrine\Common\EventManager $eventManager
  */
 protected function __construct(Connection $conn, Configuration $config, EventManager $eventManager)
 {
     $this->_conn = $conn;
     $this->_config = $config;
     $this->_eventManager = $eventManager;
     $this->_metadataFactory = new ClassMetadataFactory($this);
     $this->_metadataFactory->setCacheDriver($this->_config->getMetadataCacheImpl());
     $this->_unitOfWork = new UnitOfWork($this);
     $this->_proxyFactory = new ProxyFactory($this, $config->getProxyDir(), $config->getProxyNamespace(), $config->getAutoGenerateProxyClasses());
 }
开发者ID:skoop,项目名称:doctrine2,代码行数:18,代码来源:EntityManager.php

示例3: __construct

 /**
  * Creates a new EntityManager that operates on the given database connection
  * and uses the given Configuration and EventManager implementations.
  *
  * @param \Doctrine\DBAL\Connection     $conn
  * @param \Doctrine\ORM\Configuration   $config
  * @param \Doctrine\Common\EventManager $eventManager
  */
 protected function __construct(Connection $conn, Configuration $config, EventManager $eventManager)
 {
     $this->conn = $conn;
     $this->config = $config;
     $this->eventManager = $eventManager;
     $metadataFactoryClassName = $config->getClassMetadataFactoryName();
     $this->metadataFactory = new $metadataFactoryClassName();
     $this->metadataFactory->setEntityManager($this);
     $this->metadataFactory->setCacheDriver($this->config->getMetadataCacheImpl());
     $this->repositoryFactory = $config->getRepositoryFactory();
     $this->unitOfWork = new UnitOfWork($this);
     $this->proxyFactory = new ProxyFactory($this, $config->getProxyDir(), $config->getProxyNamespace(), $config->getAutoGenerateProxyClasses());
 }
开发者ID:Dren-x,项目名称:mobit,代码行数:21,代码来源:EntityManager.php

示例4: setUp

 /**
  * @param mixed $classes
  * @return void
  */
 public function setUp()
 {
     $this->doctrine = Zend_Registry::get('container')->getService('doctrine');
     $this->em = $this->doctrine->getEntityManager();
     $this->em->clear();
     $tool = new SchemaTool($this->em);
     $tool->dropDatabase();
     $classes = func_get_args();
     if (!empty($classes)) {
         $metadataFactory = new ClassMetadataFactory();
         $metadataFactory->setEntityManager($this->em);
         $metadataFactory->setCacheDriver(new ArrayCache());
         $metadata = array();
         foreach ((array) $classes as $class) {
             $metadata[] = $metadataFactory->getMetadataFor($class);
         }
         $tool->createSchema($metadata);
     }
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:23,代码来源:RepositoryTestCase.php

示例5: setUpOrm

 /**
  * Set up entity manager
  *
  * @return Doctrine\ORM\EntityManager
  */
 protected function setUpOrm()
 {
     global $application;
     $doctrine = $application->getBootstrap()->getResource('container')->getService('doctrine');
     $orm = $doctrine->getEntityManager();
     $orm->clear();
     $tool = new SchemaTool($orm);
     $tool->dropDatabase();
     $classes = func_get_args();
     if (!empty($classes)) {
         $metadataFactory = new ClassMetadataFactory();
         $metadataFactory->setEntityManager($orm);
         $metadataFactory->setCacheDriver(new Cache());
         $metadata = array();
         foreach ((array) $classes as $class) {
             $metadata[] = $metadataFactory->getMetadataFor($class);
         }
         $tool->createSchema($metadata);
     }
     return $orm;
 }
开发者ID:nidzix,项目名称:Newscoop,代码行数:26,代码来源:TestCase.php


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