private function validatePublishing($publishing)
    {
        if ($this->isRoot() && $publishing !== null) {
            throw new \LogicException("Root page can't be scheduled published.");
        }

        if (!($publishing instanceof \DateTime)) {
            $publishing = $this->convertTimestampToDateTime($publishing);
        }

        return $publishing;
    }
private function validatePublishing($publishing)
    {
        if ($this->isRoot() && $publishing !== null) {
            throw new \LogicException("Root page can't be scheduled published.");
        }

        if (!($publishing instanceof \DateTime)) {
            $publishing = $this->convertTimestampToDateTime($publishing);
        }

        return $publishing;
    }
private function validatePublishing ( $ publishing ) { if ( $ this -> isRoot ( ) && $ publishing !== null ) { throw new \ LogicException ( "Root page can't be scheduled published." ) ; } if ( ! ( $ publishing instanceof \ DateTime ) ) { $ publishing = $ this -> convertTimestampToDateTime ( $ publishing ) ; } return $ publishing ; }
Validate the publishing date.

@param  \DateTime            $publishing

@return \DateTime

@throws \LogicException                          Raises if this page is root and publishing not null
or page not root but publishing datetime in the past.
Validate the publishing date .