public function publishDateStatus()
    {
        $now = new DateTime();
        $publish = $this->publishDate();
        $expiry  = $this->expiryDate();
        $status  = $this->publishStatus();

        if ($status !== static::STATUS_PUBLISHED) {
            return $status;
        }

        if (!$publish) {
            if (!$expiry || $now < $expiry) {
                return static::STATUS_PUBLISHED;
            } else {
                return static::STATUS_EXPIRED;
            }
        } else {
            if ($now < $publish) {
                return static::STATUS_UPCOMING;
            } else {
                if (!$expiry || $now < $expiry) {
                    return static::STATUS_PUBLISHED;
                } else {
                    return static::STATUS_EXPIRED;
                }
            }
        }
    }
public function publishDateStatus()
    {
        $now = new DateTime();
        $publish = $this->publishDate();
        $expiry  = $this->expiryDate();
        $status  = $this->publishStatus();

        if ($status !== static::STATUS_PUBLISHED) {
            return $status;
        }

        if (!$publish) {
            if (!$expiry || $now < $expiry) {
                return static::STATUS_PUBLISHED;
            } else {
                return static::STATUS_EXPIRED;
            }
        } else {
            if ($now < $publish) {
                return static::STATUS_UPCOMING;
            } else {
                if (!$expiry || $now < $expiry) {
                    return static::STATUS_PUBLISHED;
                } else {
                    return static::STATUS_EXPIRED;
                }
            }
        }
    }
public function publishDateStatus ( ) { $ now = new DateTime ( ) ; $ publish = $ this -> publishDate ( ) ; $ expiry = $ this -> expiryDate ( ) ; $ status = $ this -> publishStatus ( ) ; if ( $ status !== static :: STATUS_PUBLISHED ) { return $ status ; } if ( ! $ publish ) { if ( ! $ expiry || $ now < $ expiry ) { return static :: STATUS_PUBLISHED ; } else { return static :: STATUS_EXPIRED ; } } else { if ( $ now < $ publish ) { return static :: STATUS_UPCOMING ; } else { if ( ! $ expiry || $ now < $ expiry ) { return static :: STATUS_PUBLISHED ; } else { return static :: STATUS_EXPIRED ; } } } }
Retrieve the object's publication status based on publication and expiration dates.

- If the publication status is not "published", that status is returned (e.g., "draft", "pending", NULL).
- If no publication date is set, then it's assumed to be always published (or "expired").
- If no expiration date is set, then it's assumed to never expire.
- If a publication date is set to a future date, then it's assumed to be scheduled to be published ("upcoming").

@return string|null
Retrieve the object s publication status based on publication and expiration dates .