当前位置: 首页>>代码示例>>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;未经允许,请勿转载。