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


PHP ObjectManager::getConfiguration方法代码示例

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


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

示例1: setUp

 /**
  * Test setup
  */
 protected function setUp()
 {
     // setup entity aliases
     $this->em = DoctrineTestHelper::createTestEntityManager();
     $entityManagerNamespaces = $this->em->getConfiguration()->getEntityNamespaces();
     $entityManagerNamespaces['WebtownPhpBannerBundle'] = 'WebtownPhp\\BannerBundle\\Entity';
     $this->em->getConfiguration()->setEntityNamespaces($entityManagerNamespaces);
     // setup schema
     $schemaTool = new SchemaTool($this->em);
     $classes = [];
     foreach ($this->getEntities() as $entityClass) {
         $classes[] = $this->em->getClassMetadata($entityClass);
     }
     try {
         $schemaTool->dropSchema($classes);
     } catch (\Exception $e) {
     }
     try {
         $schemaTool->createSchema($classes);
     } catch (\Exception $e) {
     }
     $registry = \Mockery::mock('Doctrine\\Bundle\\DoctrineBundle\\Registry');
     $registry->shouldReceive('getManager')->andReturn($this->em);
     $this->bm = new ORMManager($registry, new EventDispatcher());
 }
开发者ID:webtown-php,项目名称:BannerBundle,代码行数:28,代码来源:OMTestCase.php

示例2: __construct

 /**
  * Initializes extension driver
  *
  * @param ObjectManager $objectManager
  * @param string $extensionNamespace
  * @param object $annotationReader
  */
 public function __construct(ObjectManager $objectManager, $extensionNamespace, $annotationReader)
 {
     $this->objectManager = $objectManager;
     $this->annotationReader = $annotationReader;
     $this->extensionNamespace = $extensionNamespace;
     $omDriver = $objectManager->getConfiguration()->getMetadataDriverImpl();
     $this->driver = $this->getDriver($omDriver);
 }
开发者ID:pabloasc,项目名称:test_social,代码行数:15,代码来源:ExtensionMetadataFactory.php

示例3: getSubClasses

 /**
  * @param string $class
  * @param ObjectManager $om
  * @return array
  */
 private function getSubClasses($class, ObjectManager $om)
 {
     $classes = [];
     foreach ($om->getConfiguration()->getMetadataDriverImpl()->getAllClassNames() as $className) {
         if (is_subclass_of($className, $class, true)) {
             $classes[] = $className;
         }
     }
     return $classes;
 }
开发者ID:coolms,项目名称:doctrine,代码行数:15,代码来源:DiscriminatorEntrySubscriber.php

示例4: getEntityStatus

 /**
  * Returns information about which entities exist and possibly if their
  * mapping information contains errors or not.
  *
  * @return array
  */
 public function getEntityStatus()
 {
     $entityClassNames = $this->entityManager->getConfiguration()->getMetadataDriverImpl()->getAllClassNames();
     $info = array();
     foreach ($entityClassNames as $entityClassName) {
         try {
             $info[$entityClassName] = $this->entityManager->getClassMetadata($entityClassName);
         } catch (\Doctrine\ORM\Mapping\MappingException $e) {
             $info[$entityClassName] = $e->getMessage();
         }
     }
     return $info;
 }
开发者ID:patrickreck,项目名称:flow-development-collection,代码行数:19,代码来源:Service.php

示例5: __construct

 /**
  * Initializes extension driver.
  *
  * @param \Doctrine\Common\Persistence\ObjectManager $objectManager
  * @param string $extensionNamespace
  * @param object $annotationReader
  */
 public function __construct(ObjectManager $objectManager, $extensionNamespace, $annotationReader)
 {
     $this->objectManager = $objectManager;
     $this->annotationReader = $annotationReader;
     $this->extensionNamespace = $extensionNamespace;
     $omDriver = $objectManager->getConfiguration()->getMetadataDriverImpl();
     $omCache = $this->objectManager->getMetadataFactory()->getCacheDriver();
     $metadataClassName = null;
     if (class_exists($this->extensionNamespace . '\\Mapping\\ClassMetadata')) {
         $metadataClassName = $this->extensionNamespace . '\\Mapping\\ClassMetadata';
     }
     $driver = $this->getDriver($omDriver);
     $driver->setBaseMetadataFactory($objectManager->getMetadataFactory());
     parent::__construct($driver, $omCache, $extensionNamespace, $metadataClassName);
 }
开发者ID:norzechowicz,项目名称:doctrine-extensions,代码行数:22,代码来源:ExtendedMetadataFactory.php

示例6: getSql

 /**
  * @param DoctrineSqlFilter $sqlFilter
  * @param ClassMetadata $targetEntity
  * @param string $targetTableAlias
  * @return string
  * @throws InvalidQueryRewritingConstraintException
  * @throws \Exception
  */
 public function getSql(DoctrineSqlFilter $sqlFilter, ClassMetadata $targetEntity, $targetTableAlias)
 {
     $targetEntityPropertyName = strpos($this->path, '.') ? substr($this->path, 0, strpos($this->path, '.')) : $this->path;
     $quoteStrategy = $this->entityManager->getConfiguration()->getQuoteStrategy();
     if ($targetEntity->hasAssociation($targetEntityPropertyName) === FALSE) {
         return $this->getSqlForSimpleProperty($sqlFilter, $quoteStrategy, $targetEntity, $targetTableAlias, $targetEntityPropertyName);
     } elseif (strstr($this->path, '.') === FALSE && $targetEntity->isSingleValuedAssociation($targetEntityPropertyName) === TRUE && $targetEntity->isAssociationInverseSide($targetEntityPropertyName) === FALSE) {
         return $this->getSqlForManyToOneAndOneToOneRelationsWithoutPropertyPath($sqlFilter, $quoteStrategy, $targetEntity, $targetTableAlias, $targetEntityPropertyName);
     } elseif ($targetEntity->isSingleValuedAssociation($targetEntityPropertyName) === TRUE && $targetEntity->isAssociationInverseSide($targetEntityPropertyName) === FALSE) {
         return $this->getSqlForManyToOneAndOneToOneRelationsWithPropertyPath($sqlFilter, $quoteStrategy, $targetEntity, $targetTableAlias, $targetEntityPropertyName);
     } elseif ($targetEntity->isSingleValuedAssociation($targetEntityPropertyName) === TRUE && $targetEntity->isAssociationInverseSide($targetEntityPropertyName) === TRUE) {
         throw new InvalidQueryRewritingConstraintException('Single valued properties from the inverse side are not supported in a content security constraint path! Got: "' . $this->path . ' ' . $this->operator . ' ' . $this->operandDefinition . '"', 1416397754);
     } elseif ($targetEntity->isCollectionValuedAssociation($targetEntityPropertyName) === TRUE) {
         throw new InvalidQueryRewritingConstraintException('Multivalued properties are not supported in a content security constraint path! Got: "' . $this->path . ' ' . $this->operator . ' ' . $this->operandDefinition . '"', 1416397655);
     }
     throw new InvalidQueryRewritingConstraintException('The configured operator of the entity constraint is not valid/supported. Got: ' . $this->operator, 1270483540);
 }
开发者ID:nlx-sascha,项目名称:flow-development-collection,代码行数:25,代码来源:PropertyConditionGenerator.php

示例7: driversFromManager

 /**
  * Create a driver from a Doctrine object manager.
  *
  * @param ObjectManager $om
  *
  * @return DriverInterface
  */
 public static function driversFromManager(ObjectManager $om)
 {
     return self::driversFromMetadataDriver($om->getConfiguration()->getMetadataDriverImpl());
 }
开发者ID:cubiche,项目名称:cubiche,代码行数:11,代码来源:DriverFactory.php


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