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


PHP DocumentManager::getPhpcrSession方法代碼示例

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


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

示例1: setUp

 public function setUp()
 {
     $this->type = 'Doctrine\\Tests\\ODM\\PHPCR\\Functional\\QuerySql2TestObj';
     $this->dm = $this->createDocumentManager();
     $this->node = $this->resetFunctionalNode($this->dm);
     $versionNode = $this->node->addNode('node1', 'nt:unstructured');
     $versionNode->setProperty('username', 'dbu');
     $versionNode->setProperty('numbers', array(3, 1, 2));
     $versionNode->setProperty('phpcr:class', $this->type);
     $versionNode = $this->node->addNode('node2', 'nt:unstructured');
     $versionNode->setProperty('username', 'johannes');
     $versionNode->setProperty('numbers', array(3, 1, 2));
     $versionNode->setProperty('phpcr:class', $this->type);
     $versionNode = $this->node->addNode('node3', 'nt:unstructured');
     $versionNode->setProperty('username', 'lsmith');
     $versionNode->setProperty('numbers', array(3, 1, 2));
     $versionNode->setProperty('phpcr:class', $this->type);
     $versionNode = $this->node->addNode('node4', 'nt:unstructured');
     $versionNode->setProperty('username', 'uwe');
     $versionNode->setProperty('numbers', array(3, 1, 2));
     $versionNode->setProperty('phpcr:class', $this->type);
     $versionNode = $this->node->addNode('node5', 'nt:unstructured');
     $versionNode->setProperty('numbers', array(3, 1, 2));
     $this->dm->getPhpcrSession()->save();
     $this->dm = $this->createDocumentManager();
 }
開發者ID:richardmiller,項目名稱:phpcr-odm,代碼行數:26,代碼來源:QuerySql2Test.php

示例2: setUp

 public function setUp()
 {
     $this->type = 'Doctrine\\Tests\\ODM\\PHPCR\\Functional\\Translation\\NameDoc';
     $this->dm = $this->createDocumentManager();
     $this->node = $this->resetFunctionalNode($this->dm);
     $user = $this->node->addNode('thename');
     $user->setProperty('phpcr:class', $this->type, \PHPCR\PropertyType::STRING);
     $this->dm->getPhpcrSession()->save();
 }
開發者ID:nicam,項目名稱:phpcr-odm,代碼行數:9,代碼來源:TranslationHierarchyTest.php

示例3: testFindByClass

 public function testFindByClass()
 {
     $user = $this->node->addNode('userWithAlias');
     $user->setProperty('username', 'dbu');
     $user->setProperty('numbers', array(3, 1, 2));
     $user->setProperty('phpcr:class', $this->type, \PHPCR\PropertyType::STRING);
     $this->dm->getPhpcrSession()->save();
     $userWithAlias = $this->dm->find(null, '/functional/userWithAlias');
     $this->assertEquals('dbu', $userWithAlias->username);
 }
開發者ID:nicam,項目名稱:phpcr-odm,代碼行數:10,代碼來源:BasicCrudTest.php

示例4: setUp

 public function setUp()
 {
     $this->type = 'Doctrine\\Tests\\Models\\CMS\\CmsUser';
     $this->dm = $this->createDocumentManager(array(__DIR__));
     $this->node = $this->resetFunctionalNode($this->dm);
     $user = $this->node->addNode('lsmith');
     $user->setProperty('username', 'lsmith');
     $user->setProperty('numbers', array(3, 1, 2));
     $user->setProperty('phpcr:class', $this->type, PropertyType::STRING);
     $this->dm->getPhpcrSession()->save();
 }
開發者ID:richardmiller,項目名稱:phpcr-odm,代碼行數:11,代碼來源:MoveTest.php

示例5: testRemoveVersion

 public function testRemoveVersion()
 {
     $doc = $this->dm->find($this->type, '/functional/versionTestObj');
     $this->dm->checkpoint($doc);
     $linearVersionHistory = $this->dm->getAllLinearVersions($doc);
     $lastVersion = end($linearVersionHistory);
     $lastVersionName = $lastVersion['name'];
     // Create a new version so that we are not trying to remove the last version
     $this->dm->checkpoint($doc);
     // Remove the version
     $version = $this->dm->findVersionByName($this->type, '/functional/versionTestObj', $lastVersionName);
     $removedVersionPath = $version->id;
     $this->dm->removeVersion($version);
     // Check it's not in the history anymore
     $this->assertFalse($this->dm->getPhpcrSession()->nodeExists(dirname($removedVersionPath)));
     return $lastVersionName;
 }
開發者ID:nicam,項目名稱:phpcr-odm,代碼行數:17,代碼來源:VersioningTest.php


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