public function isOnline($ignoreSchedule = false)
    {
        $onlineByState = ($this->getState() & self::STATE_ONLINE) && !($this->getState() & self::STATE_DELETED);

        if (true === $ignoreSchedule) {
            return $onlineByState;
        } else {
            return $onlineByState
                && (null === $this->getPublishing() || 0 === $this->getPublishing()->diff(new \DateTime())->invert)
                && (null === $this->getArchiving() || 1 === $this->getArchiving()->diff(new \DateTime())->invert)
            ;
        }
    }
public function isOnline($ignoreSchedule = false)
    {
        $onlineByState = ($this->getState() & self::STATE_ONLINE) && !($this->getState() & self::STATE_DELETED);

        if (true === $ignoreSchedule) {
            return $onlineByState;
        } else {
            return $onlineByState
                && (null === $this->getPublishing() || 0 === $this->getPublishing()->diff(new \DateTime())->invert)
                && (null === $this->getArchiving() || 1 === $this->getArchiving()->diff(new \DateTime())->invert)
            ;
        }
    }
public function isOnline ( $ ignoreSchedule = false ) { $ onlineByState = ( $ this -> getState ( ) & self :: STATE_ONLINE ) && ! ( $ this -> getState ( ) & self :: STATE_DELETED ) ; if ( true === $ ignoreSchedule ) { return $ onlineByState ; } else { return $ onlineByState && ( null === $ this -> getPublishing ( ) || 0 === $ this -> getPublishing ( ) -> diff ( new \ DateTime ( ) ) -> invert ) && ( null === $ this -> getArchiving ( ) || 1 === $ this -> getArchiving ( ) -> diff ( new \ DateTime ( ) ) -> invert ) ; } }
Is the page online?

@param  boolean              $ignoreSchedule     Don't take care of publishing period.

@return boolean                                  True if the page is online, false otherwise.
Is the page online?