public function calculate_expiry($timestamp) {
        $expiry = null;

        if (isset($this->expiredate)) {
            $expiry = $this->expiredate;
        } else if (isset($this->expireperiod)) {
            $expiry = $timestamp + $this->expireperiod;
        }

        return $expiry;
    }
public function calculate_expiry($timestamp) {
        $expiry = null;

        if (isset($this->expiredate)) {
            $expiry = $this->expiredate;
        } else if (isset($this->expireperiod)) {
            $expiry = $timestamp + $this->expireperiod;
        }

        return $expiry;
    }
public function calculate_expiry ( $ timestamp ) { $ expiry = null ; if ( isset ( $ this -> expiredate ) ) { $ expiry = $ this -> expiredate ; } else if ( isset ( $ this -> expireperiod ) ) { $ expiry = $ timestamp + $ this -> expireperiod ; } return $ expiry ; }
Calculates badge expiry date based on either expirydate or expiryperiod.

@param int $timestamp Time of badge issue
@return int A timestamp
Calculates badge expiry date based on either expirydate or expiryperiod .