コード例 #1
0
ファイル: Entity.php プロジェクト: daveoncode/pongo
 /**
  * If the entity has been saved into the database returns its save date,
  * otherwise null will be returned.
  * (Save date refers to the date of the first insertion and does not consider
  * any successive updates.)
  * @return MongoDate Date
  */
 public function getSaveDate()
 {
     if (!isset($this->_id)) {
         return null;
     }
     return Utils::createMongoDate(0, 0, 0, 0, 0, $this->_id->getTimestamp());
 }
コード例 #2
0
ファイル: UtilsTest.php プロジェクト: daveoncode/pongo
 public function testMongoDateToStringReturnsExpectedString()
 {
     $d = Utils::createMongoDate(2000, 5, 5);
     $this->assertEquals(Utils::mongoDateToString($d, 'd-m-Y'), '05-05-2000');
 }