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


PHP DocumentManager::getClassMetadata方法代碼示例

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


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

示例1: testProxyFactorySetsProxyMetadata

 public function testProxyFactorySetsProxyMetadata()
 {
     $proxy = $this->dm->getReference($this->type, 1);
     $proxyClass = get_class($proxy);
     $this->assertTrue($this->dm->getClassMetadataFactory()->hasMetadataFor($proxyClass), "Proxy class '" . $proxyClass . "' should be registered as metadata.");
     $this->assertSame($this->dm->getClassMetadata($proxyClass), $this->dm->getClassMetadata($this->type), "Metadata instances of proxy class and real instance have to be the same.");
 }
開發者ID:hlubek,項目名稱:couchdb-odm,代碼行數:7,代碼來源:ProxyTest.php

示例2: setUp

 public function setUp()
 {
     $this->dm = $this->createDocumentManager();
     $class = $this->dm->getClassMetadata('Doctrine\\Tests\\Models\\CMS\\CmsUser');
     $class->associationsMappings['groups']['cascade'] = ClassMetadata::CASCADE_REMOVE;
     $class = $this->dm->getClassMetadata('Doctrine\\Tests\\Models\\CMS\\CmsGroup');
     $class->associationsMappings['users']['cascade'] = ClassMetadata::CASCADE_REMOVE;
     $class = $this->dm->getClassMetadata('Doctrine\\Tests\\Models\\CMS\\CmsArticle');
     $class->associationsMappings['user']['cascade'] = ClassMetadata::CASCADE_REMOVE;
 }
開發者ID:doctrine,項目名稱:couchdb-odm,代碼行數:10,代碼來源:CascadeRemoveTest.php

示例3: setUp

 public function setUp()
 {
     $this->markTestSkipped('Cascade refresh does not work yet.');
     $this->dm = $this->createDocumentManager();
     $class = $this->dm->getClassMetadata('Doctrine\\Tests\\Models\\CMS\\CmsUser');
     $class->associationsMappings['groups']['cascade'] = ClassMetadata::CASCADE_REFRESH;
     $class = $this->dm->getClassMetadata('Doctrine\\Tests\\Models\\CMS\\CmsGroup');
     $class->associationsMappings['users']['cascade'] = ClassMetadata::CASCADE_REFRESH;
     $class = $this->dm->getClassMetadata('Doctrine\\Tests\\Models\\CMS\\CmsArticle');
     $class->associationsMappings['user']['cascade'] = ClassMetadata::CASCADE_REFRESH;
 }
開發者ID:doctrine,項目名稱:couchdb-odm,代碼行數:11,代碼來源:CascadeRefreshTest.php

示例4: setUp

 public function setUp()
 {
     $this->dm = $this->createDocumentManager(array(__DIR__));
     $this->node = $this->resetFunctionalNode($this->dm);
     $class = $this->dm->getClassMetadata('Doctrine\\Tests\\Models\\CMS\\CmsUser');
     $class->mappings['groups']['cascade'] = ClassMetadata::CASCADE_REFRESH;
     $class = $this->dm->getClassMetadata('Doctrine\\Tests\\Models\\CMS\\CmsGroup');
     $class->mappings['users']['cascade'] = ClassMetadata::CASCADE_REFRESH;
     $class = $this->dm->getClassMetadata('Doctrine\\Tests\\Models\\CMS\\CmsArticle');
     $class->mappings['user']['cascade'] = ClassMetadata::CASCADE_REFRESH;
 }
開發者ID:steffenbrem,項目名稱:phpcr-odm,代碼行數:11,代碼來源:CascadeRefreshTest.php

示例5: testIdStrategy

 public function testIdStrategy()
 {
     $metadata = $this->dm->getClassMetadata('\\Doctrine\\Tests\\ODM\\PHPCR\\Functional\\Mapping\\ParentIdStrategy');
     $this->assertEquals(ClassMetadata::GENERATOR_TYPE_PARENT, $metadata->idGenerator, 'parentId');
     $metadata = $this->dm->getClassMetadata('\\Doctrine\\Tests\\ODM\\PHPCR\\Functional\\Mapping\\ParentIdStrategyDifferentOrder');
     $this->assertEquals(ClassMetadata::GENERATOR_TYPE_PARENT, $metadata->idGenerator, 'parentId2');
     $metadata = $this->dm->getClassMetadata('\\Doctrine\\Tests\\ODM\\PHPCR\\Functional\\Mapping\\AssignedIdStrategy');
     $this->assertEquals(ClassMetadata::GENERATOR_TYPE_ASSIGNED, $metadata->idGenerator, 'assigned');
     $metadata = $this->dm->getClassMetadata('\\Doctrine\\Tests\\ODM\\PHPCR\\Functional\\Mapping\\RepositoryIdStrategy');
     $this->assertEquals(ClassMetadata::GENERATOR_TYPE_REPOSITORY, $metadata->idGenerator, 'repository');
     $metadata = $this->dm->getClassMetadata('\\Doctrine\\Tests\\ODM\\PHPCR\\Functional\\Mapping\\AutoAssignedIdStrategy');
     $this->assertEquals(ClassMetadata::GENERATOR_TYPE_ASSIGNED, $metadata->idGenerator, 'autoassigned');
     $metadata = $this->dm->getClassMetadata('\\Doctrine\\Tests\\ODM\\PHPCR\\Functional\\Mapping\\StandardCase');
     $this->assertEquals(ClassMetadata::GENERATOR_TYPE_ASSIGNED, $metadata->idGenerator, 'standardcase');
 }
開發者ID:richardmiller,項目名稱:phpcr-odm,代碼行數:15,代碼來源:AnnotationMappingTest.php


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