Created
March 26, 2013 11:13
-
-
Save eb-eoliveira/5244648 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Set sent at now. | |
* | |
* @return ItemSent | |
*/ | |
public function setSentAtNow() | |
{ | |
return $this->setSentAt(new \DateTime()); | |
} | |
/** | |
* Set sent at. | |
* | |
* @param \DateTime $sentAt Sent at. | |
* | |
* @return ItemSent | |
*/ | |
public function setSentAt(\DateTime $sentAt) | |
{ | |
$this->set(self::KEY_SENT_AT, $sentAt->getTimestamp()); | |
return $this; | |
} | |
/** | |
* Return set at. | |
* | |
* @return \DateTime | |
*/ | |
public function getSentAt() | |
{ | |
return ( | |
(new \DateTime())->setTimestamp($this->get(self::KEY_SENT_AT)) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment