Back to Document class

Method setModifiedDate

public \Joomla\CMS\Document\Document
setModifiedDate
(mixed $date)
Sets the document modified date
Parameters
  • string|\Joomla\CMS\Date\Date $date The date to be set
Returns
  • \Joomla\CMS\Document\Document instance of $this to allow chaining
Since
  • 1.7.0
-
  • \InvalidArgumentException
Class: Document
Project: Joomla

Method setModifiedDate - Source code

/**
 * Sets the document modified date
 *
 * @param   string|Date  $date  The date to be set
 *
 * @return  Document instance of $this to allow chaining
 *
 * @since   1.7.0
 * @throws  \InvalidArgumentException
 */
public function setModifiedDate($date)
{
    if (!\is_string($date) && !$date instanceof Date) {
        throw new \InvalidArgumentException(sprintf('The $date parameter of %1$s must be a string or a %2$s instance, a %3$s was given.', __METHOD__ . '()', 'Joomla\\CMS\\Date\\Date', \gettype($date) === 'object' ? \get_class($date) . ' instance' : \gettype($date)));
    }
    $this->_mdate = $date;
    return $this;
}