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


PHP DocumentManager::getConfiguration方法代碼示例

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


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

示例1: testFindWithNamespace

 public function testFindWithNamespace()
 {
     $config = $this->dm->getConfiguration();
     $config->addDocumentNamespace('Foobar', 'Doctrine\\Tests\\ODM\\PHPCR\\Functional');
     $user = $this->dm->find('Foobar:TypeUser', 'functional/user');
     $this->assertNotNull($user);
 }
開發者ID:nikophil,項目名稱:cmf-tests,代碼行數:7,代碼來源:FindTypeValidationTest.php

示例2: testGetAllMetadata

 public function testGetAllMetadata()
 {
     $driver = new \Doctrine\Common\Persistence\Mapping\Driver\PHPDriver(array(__DIR__ . '/Model/php'));
     $this->dm->getConfiguration()->setMetadataDriverImpl($driver);
     $cmf = new ClassMetadataFactory($this->dm);
     $cm = new \Doctrine\ODM\PHPCR\Mapping\ClassMetadata('stdClass');
     $cmf->setMetadataFor('stdClass', $cm);
     $metadata = $cmf->getAllMetadata();
     $this->assertTrue(is_array($metadata));
 }
開發者ID:steffenbrem,項目名稱:phpcr-odm,代碼行數:10,代碼來源:ClassMetadataFactoryTest.php

示例3: createRepository

 /**
  * Create a new repository instance for a document class.
  *
  * @param DocumentManager $documentManager The DocumentManager instance.
  * @param string          $documentName    The name of the document.
  *
  * @return \Doctrine\Common\Persistence\ObjectRepository
  */
 protected function createRepository(DocumentManager $documentManager, $documentName)
 {
     $metadata = $documentManager->getClassMetadata($documentName);
     $repositoryClassName = $metadata->customRepositoryClassName;
     if ($repositoryClassName === null) {
         $configuration = $documentManager->getConfiguration();
         $repositoryClassName = $configuration->getDefaultRepositoryClassName();
     }
     return new $repositoryClassName($documentManager, $metadata);
 }
開發者ID:nikophil,項目名稱:cmf-tests,代碼行數:18,代碼來源:DefaultRepositoryFactory.php

示例4: testFromWithAlias

 public function testFromWithAlias()
 {
     $config = $this->dm->getConfiguration();
     $config->addDocumentNamespace('Foobar', 'Doctrine\\Tests\\Models\\Blog');
     $qb = $this->createQb();
     $qb->from()->document('Foobar:User', 'a');
     // add where to stop rouge documents that havn't been stored in /functional/ from appearing.
     $qb->where()->eq()->field('a.status')->literal('query_builder')->end();
     $res = $qb->getQuery()->execute();
     $this->assertCount(2, $res);
 }
開發者ID:steffenbrem,項目名稱:phpcr-odm,代碼行數:11,代碼來源:QueryBuilderTest.php

示例5: testFindByUuid

 public function testFindByUuid()
 {
     $generator = $this->dm->getConfiguration()->getUuidGenerator();
     $user = $this->dm->find(null, $generator());
     $this->assertNull($user);
     $newUser = new UserWithUuid();
     $newUser->username = 'test';
     $newUser->id = '/functional/test';
     $this->dm->persist($newUser);
     $this->dm->flush();
     $this->dm->clear();
     $foundUser = $this->dm->find(null, $newUser->uuid);
     $this->assertNotNull($foundUser);
     $this->assertEquals('test', $foundUser->username);
     $this->assertEquals('/functional/test', $foundUser->id);
 }
開發者ID:steffenbrem,項目名稱:phpcr-odm,代碼行數:16,代碼來源:BasicCrudTest.php

示例6: prefetch

 /**
  * @param NodeInterface[] $nodes
  */
 public function prefetch(DocumentManager $dm, $nodes, $locale = null)
 {
     if (!count($nodes)) {
         return;
     }
     $uuids = array();
     $paths = array();
     $documentClassMapper = $dm->getConfiguration()->getDocumentClassMapper();
     foreach ($nodes as $node) {
         $className = $documentClassMapper->getClassName($dm, $node);
         $class = $dm->getClassMetadata($className);
         if (!$locale && $class->translator) {
             $locale = $dm->getLocaleChooserStrategy()->getLocale();
         }
         $uuids = array_merge($uuids, $this->collectPrefetchReferences($class, $node));
         $paths = array_merge($paths, $this->collectPrefetchHierarchy($class, $node, $locale));
     }
     if (count($uuids)) {
         $node->getSession()->getNodesByIdentifier($uuids);
     }
     if (count($paths)) {
         $node->getSession()->getNodes($paths);
     }
 }
開發者ID:nikophil,項目名稱:cmf-tests,代碼行數:27,代碼來源:PrefetchHelper.php

示例7: __construct

 /**
  * @param DocumentManager $dm
  */
 public function __construct(DocumentManager $dm)
 {
     $this->dm = $dm;
     $this->session = $dm->getPhpcrSession();
     $this->eventListenersInvoker = new ListenersInvoker($dm);
     $this->eventManager = $dm->getEventManager();
     $config = $dm->getConfiguration();
     $this->documentClassMapper = $config->getDocumentClassMapper();
     $this->validateDocumentName = $config->getValidateDoctrineMetadata();
     $this->writeMetadata = $config->getWriteDoctrineMetadata();
     $this->uuidGenerator = $config->getUuidGenerator();
     if ($this->session instanceof JackalopeSession) {
         $this->useFetchDepth = 'jackalope.fetch_depth';
     }
 }
開發者ID:nikophil,項目名稱:cmf-tests,代碼行數:18,代碼來源:UnitOfWork.php

示例8: getFqcnFromAlias

 /**
  * {@inheritdoc}
  */
 protected function getFqcnFromAlias($namespaceAlias, $simpleClassName)
 {
     return $this->dm->getConfiguration()->getDocumentNamespace($namespaceAlias) . '\\' . $simpleClassName;
 }
開發者ID:nikophil,項目名稱:cmf-tests,代碼行數:7,代碼來源:ClassMetadataFactory.php

示例9: __construct

 /**
  * @param DocumentManager $dm
  */
 public function __construct(DocumentManager $dm)
 {
     $this->dm = $dm;
     $this->session = $dm->getPhpcrSession();
     $this->evm = $dm->getEventManager();
     $config = $dm->getConfiguration();
     $this->documentClassMapper = $config->getDocumentClassMapper();
     $this->validateDocumentName = $config->getValidateDoctrineMetadata();
     $this->writeMetadata = $config->getWriteDoctrineMetadata();
 }
開發者ID:nicam,項目名稱:phpcr-odm,代碼行數:13,代碼來源:UnitOfWork.php


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