public function setLastModificationDate($time)
    {
        if (empty($time) && !is_numeric($time)) {
            $this->lastModificationDate = null;

            return $this;
        }

        if (is_string($time)) {
            try {
                $time = new DateTime($time);
            } catch (Exception $e) {
                throw new InvalidArgumentException(sprintf(
                    'Invalid Updated Date: %s',
                    $e->getMessage()
                ), $e->getCode(), $e);
            }
        }

        if (!$time instanceof DateTimeInterface) {
            throw new InvalidArgumentException(
                'Updated Date must be a date/time string or an instance of DateTimeInterface'
            );
        }

        $this->lastModificationDate = $time;

        return $this;
    }
public function setLastModificationDate($time)
    {
        if (empty($time) && !is_numeric($time)) {
            $this->lastModificationDate = null;

            return $this;
        }

        if (is_string($time)) {
            try {
                $time = new DateTime($time);
            } catch (Exception $e) {
                throw new InvalidArgumentException(sprintf(
                    'Invalid Updated Date: %s',
                    $e->getMessage()
                ), $e->getCode(), $e);
            }
        }

        if (!$time instanceof DateTimeInterface) {
            throw new InvalidArgumentException(
                'Updated Date must be a date/time string or an instance of DateTimeInterface'
            );
        }

        $this->lastModificationDate = $time;

        return $this;
    }
public function setLastModificationDate ( $ time ) { if ( empty ( $ time ) && ! is_numeric ( $ time ) ) { $ this -> lastModificationDate = null ; return $ this ; } if ( is_string ( $ time ) ) { try { $ time = new DateTime ( $ time ) ; } catch ( Exception $ e ) { throw new InvalidArgumentException ( sprintf ( 'Invalid Updated Date: %s' , $ e -> getMessage ( ) ) , $ e -> getCode ( ) , $ e ) ; } } if ( ! $ time instanceof DateTimeInterface ) { throw new InvalidArgumentException ( 'Updated Date must be a date/time string or an instance of DateTimeInterface' ) ; } $ this -> lastModificationDate = $ time ; return $ this ; }
Set the route's last modification date.

@param  string|DateTimeInterface|null $time The date/time value.
@throws InvalidArgumentException If the date/time value is invalid.
@return self
Set the route s last modification date .