public function Entry::setDateModified in Zircon Profile 8.0
Same name and namespace in other branches
- 8 vendor/zendframework/zend-feed/src/Writer/Entry.php \Zend\Feed\Writer\Entry::setDateModified()
Set the feed modification date
Parameters
null|int|DateTime $date:
Return value
Throws
Exception\InvalidArgumentException
File
- vendor/
zendframework/ zend-feed/ src/ Writer/ Entry.php, line 203
Class
Namespace
Zend\Feed\WriterCode
public function setDateModified($date = null) {
if ($date === null) {
$date = new DateTime();
}
elseif (is_int($date)) {
$date = new DateTime('@' . $date);
}
elseif (!$date instanceof DateTime) {
throw new Exception\InvalidArgumentException('Invalid DateTime object or UNIX Timestamp passed as parameter');
}
$this->data['dateModified'] = $date;
return $this;
}