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


PHP Versioned::reading_archived_date方法代碼示例

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


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

示例1: testArchiveRelatedDataWithoutVersioned

 public function testArchiveRelatedDataWithoutVersioned()
 {
     SS_Datetime::set_mock_now('2009-01-01 00:00:00');
     $relatedData = new VersionedTest_RelatedWithoutVersion();
     $relatedData->Name = 'Related Data';
     $relatedDataId = $relatedData->write();
     $testData = new VersionedTest_DataObject();
     $testData->Title = 'Test';
     $testData->Content = 'Before Content';
     $testData->Related()->add($relatedData);
     $id = $testData->write();
     SS_Datetime::set_mock_now('2010-01-01 00:00:00');
     $testData->Content = 'After Content';
     $testData->write();
     Versioned::reading_archived_date('2009-01-01 19:00:00');
     $fetchedData = VersionedTest_DataObject::get()->byId($id);
     $this->assertEquals('Before Content', $fetchedData->Content, 'We see the correct content of the older version');
     $relatedData = VersionedTest_RelatedWithoutVersion::get()->byId($relatedDataId);
     $this->assertEquals(1, $relatedData->Related()->count(), 'We have a relation, with no version table, querying it still works');
 }
開發者ID:jakedaleweb,項目名稱:AtomCodeChallenge,代碼行數:20,代碼來源:VersionedTest.php

示例2: testReadArchiveDate

 /**
  * Simple test to confirm that querying from a particular archive date doesn't throw
  * an error
  */
 public function testReadArchiveDate()
 {
     $date = '2009-07-02 14:05:07';
     Versioned::reading_archived_date($date);
     DataObject::get('SiteTree', "\"SiteTree\".\"ParentID\" = 0");
     Versioned::reading_archived_date(null);
     $this->assertEquals(Versioned::get_reading_mode(), 'Archive.');
 }
開發者ID:fanggu,項目名稱:loveyourwater_ss_v3.1.6,代碼行數:12,代碼來源:SiteTreeTest.php

示例3:

 /**
  * Set the reading archive date.
  * @param string $date New reading archived date.
  */
 static function reading_archived_date($date)
 {
     Versioned::$reading_archived_date = $date;
 }
開發者ID:ramziammar,項目名稱:websites,代碼行數:8,代碼來源:Versioned.php

示例4: testReadArchiveDate

 /**
  * Simple test to confirm that querying from a particular archive date doesn't throw
  * an error
  */
 public function testReadArchiveDate()
 {
     $date = '2009-07-02 14:05:07';
     Versioned::reading_archived_date($date);
     SiteTree::get()->where(array('"SiteTree"."ParentID"' => 0));
     Versioned::reading_archived_date(null);
     $this->assertEquals(Versioned::get_reading_mode(), 'Archive.');
 }
開發者ID:Neumes,項目名稱:silverstripe-cms,代碼行數:12,代碼來源:SiteTreeTest.php

示例5: testReadArchiveDate

 /**
  * Simple test to confirm that querying from a particular archive date doesn't throw
  * an error
  */
 function testReadArchiveDate()
 {
     Versioned::reading_archived_date('2009-07-02 14:05:07');
     DataObject::get('SiteTree', "\"ParentID\" = 0");
     Versioned::reading_archived_date(null);
 }
開發者ID:comperio,項目名稱:silverstripe-framework,代碼行數:10,代碼來源:SiteTreeTest.php


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