當前位置: 首頁>>代碼示例>>PHP>>正文


PHP EntityManagerInterface::getConfiguration方法代碼示例

本文整理匯總了PHP中Doctrine\ORM\EntityManagerInterface::getConfiguration方法的典型用法代碼示例。如果您正苦於以下問題:PHP EntityManagerInterface::getConfiguration方法的具體用法?PHP EntityManagerInterface::getConfiguration怎麽用?PHP EntityManagerInterface::getConfiguration使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Doctrine\ORM\EntityManagerInterface的用法示例。


在下文中一共展示了EntityManagerInterface::getConfiguration方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getProfilingLogger

 /**
  * Gets a profiling logger.
  *
  * @return OrmLogger|null
  */
 protected function getProfilingLogger()
 {
     if (null === $this->entityManager) {
         return null;
     }
     $config = $this->entityManager->getConfiguration();
     return $config instanceof OrmConfiguration ? $config->getAttribute('OrmProfilingLogger') : null;
 }
開發者ID:sagikazarmark,項目名稱:platform,代碼行數:13,代碼來源:OroClassMetadataFactory.php

示例2: boot

 /**
  * Boot the extensions
  */
 public function boot()
 {
     foreach ($this->registry->getManagers() as $em) {
         $this->em = $em;
         $this->evm = $this->em->getEventManager();
         $this->metadata = $this->em->getConfiguration();
         $this->reader = $this->driverChain->getReader();
         foreach ($this->extensions as $extension) {
             $this->bootExtension($extension);
         }
     }
 }
開發者ID:vyolla,項目名稱:orm,代碼行數:15,代碼來源:ExtensionManager.php

示例3: createRepository

 /**
  * Create a new repository instance for an entity class.
  *
  * @param \Doctrine\ORM\EntityManagerInterface $entityManager The EntityManager instance.
  * @param string                               $entityName    The name of the entity.
  *
  * @return \Doctrine\Common\Persistence\ObjectRepository
  */
 private function createRepository(EntityManagerInterface $entityManager, $entityName)
 {
     /* @var $metadata \Doctrine\ORM\Mapping\ClassMetadata */
     $metadata = $entityManager->getClassMetadata($entityName);
     $repositoryClassName = $metadata->customRepositoryClassName ?: $entityManager->getConfiguration()->getDefaultRepositoryClassName();
     return new $repositoryClassName($entityManager, $metadata);
 }
開發者ID:BusinessCookies,項目名稱:CoffeeMachineProject,代碼行數:15,代碼來源:DefaultRepositoryFactory.php

示例4: boot

 /**
  * Boot the extensions
  */
 public function boot()
 {
     foreach ($this->registry->getManagers() as $em) {
         $this->em = $em;
         $this->evm = $this->em->getEventManager();
         $this->metadata = $this->em->getConfiguration();
         $this->reader = $this->driverChain->getReader();
         $hash = spl_object_hash($em);
         if (!isset($this->subscribedExtensions[$hash])) {
             $this->subscribedExtensions[$hash] = [];
         }
         foreach ($this->extensions as $extension) {
             $this->bootExtension($extension);
         }
     }
 }
開發者ID:jee7,項目名稱:orm,代碼行數:19,代碼來源:ExtensionManager.php

示例5: __construct

 /**
  * Initializes a new SchemaTool instance that uses the connection of the
  * provided EntityManager.
  *
  * @param \Doctrine\ORM\EntityManagerInterface $em
  */
 public function __construct(EntityManagerInterface $auditEm, EntityManagerInterface $sourceEm)
 {
     $this->auditEm = $auditEm;
     $this->sourceEm = $sourceEm;
     $this->platform = $auditEm->getConnection()->getDatabasePlatform();
     $this->quoteStrategy = $auditEm->getConfiguration()->getQuoteStrategy();
 }
開發者ID:bruery,項目名稱:platform,代碼行數:13,代碼來源:SchemaTool.php

示例6: boot

 /**
  * Boot the extensions
  */
 public function boot()
 {
     foreach ($this->registry->getManagers() as $em) {
         $this->em = $em;
         $this->chain = new MappingDriverChain();
         $this->evm = $this->em->getEventManager();
         $this->metadata = $this->em->getConfiguration();
         $this->reader = method_exists($this->metadata->getMetadataDriverImpl(), 'getReader') ? $this->metadata->getMetadataDriverImpl()->getReader() : false;
         if ($this->gedmo['enabled']) {
             $this->bootGedmoExtensions($this->gedmo['namespace'], $this->gedmo['all']);
         }
         foreach ($this->extensions as $extenion) {
             $this->bootExtension($extenion);
         }
     }
 }
開發者ID:rosstuck,項目名稱:Laravel-Doctrine,代碼行數:19,代碼來源:ExtensionManager.php

示例7: __construct

 /**
  * Initializes a new instance of a class derived from AbstractCollectionPersister.
  *
  * @param EntityManagerInterface $em
  */
 public function __construct(EntityManagerInterface $em)
 {
     $this->em = $em;
     $this->uow = $em->getUnitOfWork();
     $this->conn = $em->getConnection();
     $this->platform = $this->conn->getDatabasePlatform();
     $this->quoteStrategy = $em->getConfiguration()->getQuoteStrategy();
 }
開發者ID:Dren-x,項目名稱:mobitnew,代碼行數:13,代碼來源:AbstractCollectionPersister.php

示例8: indexEntityClassNames

 /**
  * @return array
  */
 private function indexEntityClassNames()
 {
     $indexedClassNames = [];
     $entityClassNames = $this->em->getConfiguration()->getMetadataDriverImpl()->getAllClassNames();
     foreach ($entityClassNames as $name) {
         // @todo Support subtypes.
         $resourceType = Util\Inflector::typify($name);
         $indexedClassNames[$resourceType][] = $name;
     }
     //Config class override
     foreach ($this->getResourcesConfig()->getAll() as $resource) {
         if (!empty($resource->type) && !empty($resource->class)) {
             $indexedClassNames[$resource->type] = array($resource->class);
         }
     }
     return $indexedClassNames;
 }
開發者ID:gointegro,項目名稱:hateoas,代碼行數:20,代碼來源:ResourceEntityMapper.php

示例9: __construct

 /**
  * @param EntityManagerInterface $em
  * @param AuditConfiguration $config
  * @param MetadataFactory $factory
  */
 public function __construct(EntityManagerInterface $em, AuditConfiguration $config, MetadataFactory $factory)
 {
     $this->em = $em;
     $this->config = $config;
     $this->metadataFactory = $factory;
     $this->platform = $this->em->getConnection()->getDatabasePlatform();
     $this->quoteStrategy = $this->em->getConfiguration()->getQuoteStrategy();
 }
開發者ID:Soullivaneuh,項目名稱:EntityAudit,代碼行數:13,代碼來源:AuditReader.php

示例10: __construct

 /**
  * @param \Doctrine\ORM\EntityManagerInterface $em     The entity manager.
  * @param \Doctrine\ORM\Cache\Region           $region The query region.
  */
 public function __construct(EntityManagerInterface $em, Region $region)
 {
     $cacheConfig = $em->getConfiguration()->getSecondLevelCacheConfiguration();
     $this->em = $em;
     $this->region = $region;
     $this->uow = $em->getUnitOfWork();
     $this->cacheLogger = $cacheConfig->getCacheLogger();
     $this->validator = $cacheConfig->getQueryValidator();
 }
開發者ID:BusinessCookies,項目名稱:CoffeeMachineProject,代碼行數:13,代碼來源:DefaultQueryCache.php

示例11: createRepository

 /**
  * @param EntityManagerInterface $entityManager
  * @param string                 $entityName
  *
  * @return ObjectRepository
  */
 protected function createRepository(EntityManagerInterface $entityManager, $entityName)
 {
     $metadata = $entityManager->getClassMetadata($entityName);
     $repository = $metadata->customRepositoryClassName;
     if ($repository === null) {
         $repository = $entityManager->getConfiguration()->getDefaultRepositoryClassName();
     }
     return $this->createResourceRepository($repository, $entityManager, $metadata, $this->resolveResource($metadata->getName()));
 }
開發者ID:blazarecki,項目名稱:lug,代碼行數:15,代碼來源:RepositoryFactory.php

示例12: setUp

 public function setUp()
 {
     $config = new \Doctrine\ORM\Configuration();
     $config->setMetadataCacheImpl(new \Doctrine\Common\Cache\ArrayCache());
     $config->setQueryCacheImpl(new \Doctrine\Common\Cache\ArrayCache());
     $config->setProxyDir(__DIR__ . '/Proxies');
     $config->setProxyNamespace('DoctrineExtensions\\Tests\\Proxies');
     $config->setAutoGenerateProxyClasses(true);
     $config->setMetadataDriverImpl($config->newDefaultAnnotationDriver(__DIR__ . '/../Entities'));
     $config->setCustomDatetimeFunctions(array('YEAR' => 'DoctrineExtensions\\Query\\Sqlite\\Year', 'WEEKDAY' => 'DoctrineExtensions\\Query\\Sqlite\\WeekDay', 'WEEK' => 'DoctrineExtensions\\Query\\Sqlite\\Week', 'Month' => 'DoctrineExtensions\\Query\\Sqlite\\Month', 'MINUTE' => 'DoctrineExtensions\\Query\\Sqlite\\Minute', 'HOUR' => 'DoctrineExtensions\\Query\\Sqlite\\Hour', 'DAY' => 'DoctrineExtensions\\Query\\Sqlite\\Day', 'DATE' => 'DoctrineExtensions\\Query\\Sqlite\\Date', 'STRFTIME' => 'DoctrineExtensions\\Query\\Sqlite\\StrfTime', 'DATE_FORMAT' => 'DoctrineExtensions\\Query\\Sqlite\\DateFormat'));
     $this->entityManager = \Doctrine\ORM\EntityManager::create(array('driver' => 'pdo_sqlite', 'memory' => true), $config);
     $configuration = $this->entityManager->getConfiguration();
     if (method_exists($configuration, 'getQuoteStrategy') === false) {
         // doctrine < 2.3
         $this->columnAlias = 'sclr0';
     } else {
         $this->columnAlias = $configuration->getQuoteStrategy()->getColumnAlias('sclr', 0, $this->entityManager->getConnection()->getDatabasePlatform(), $this->entityManager->getClassMetadata('DoctrineExtensions\\Tests\\Entities\\Date'));
     }
 }
開發者ID:vikbert,項目名稱:DoctrineExtensions,代碼行數:19,代碼來源:SqliteTestCase.php

示例13: createRepository

 /**
  * Create a new repository instance for an entity class.
  *
  * @param \Doctrine\ORM\EntityManagerInterface $entityManager The EntityManager instance.
  * @param string                               $entityName    The name of the entity.
  *
  * @return \Doctrine\Common\Persistence\ObjectRepository
  */
 protected function createRepository(EntityManagerInterface $entityManager, $entityName)
 {
     $metadata = $entityManager->getClassMetadata($entityName);
     $repositoryClassName = $metadata->customRepositoryClassName;
     if ($repositoryClassName === null) {
         $configuration = $entityManager->getConfiguration();
         $repositoryClassName = $configuration->getDefaultRepositoryClassName();
     }
     return new $repositoryClassName($entityManager, $metadata);
 }
開發者ID:Dren-x,項目名稱:mobit,代碼行數:18,代碼來源:DefaultRepositoryFactory.php

示例14: createRepository

 /**
  * Create a new repository instance for an entity class.
  *
  * @param \Doctrine\ORM\EntityManagerInterface $entityManager The EntityManager instance.
  * @param string $entityName The name of the entity.
  *
  * @return ObjectRepository
  */
 private function createRepository(EntityManagerInterface $entityManager, $entityName)
 {
     /* @var $metadata ClassMetadata */
     $metadata = $entityManager->getClassMetadata($entityName);
     $repositoryClassName = $metadata->customRepositoryClassName ?: $entityManager->getConfiguration()->getDefaultRepositoryClassName();
     $result = new $repositoryClassName($entityManager, $metadata);
     if ($result instanceof ContainerAwareInterface) {
         $result->setContainer($this->container);
     }
     return $result;
 }
開發者ID:octava,項目名稱:cms,代碼行數:19,代碼來源:OctavaRepositoryFactory.php

示例15: getRepository

 /**
  * Gets the repository for an entity class.
  *
  * @param \Doctrine\ORM\EntityManagerInterface  $entityManager The EntityManager instance.
  * @param string                                $entityName The name of the entity.
  *
  * @return \Doctrine\Common\Persistence\ObjectRepository
  */
 public function getRepository(EntityManagerInterface $entityManager, $entityName)
 {
     if ($this->entityRepositoryManager->has($entityName)) {
         $repository = $this->entityRepositoryManager->get($entityName);
     } else {
         $entityMetadata = $entityManager->getClassMetadata($entityName);
         $className = $entityManager->getConfiguration()->getDefaultRepositoryClassName();
         /** @var EntityRepository $defaultRepository */
         $repository = new $className($entityManager, $entityMetadata);
     }
     return $repository;
 }
開發者ID:alex-patterson-webdev,項目名稱:arp-entity-repository,代碼行數:20,代碼來源:DoctrineRepositoryFactory.php


注:本文中的Doctrine\ORM\EntityManagerInterface::getConfiguration方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。