SubscriptionSection::getExpirationDate PHP 메소드

getExpirationDate() 공개 메소드

fn getStartDate
public getExpirationDate ( )
    public function getExpirationDate()
    {
        $startDate = new \DateTime(isset($this->m_data['StartDate']) ? $this->m_data['StartDate'] : 'now');
        $timeSpan = new \DateInterval('P' . $this->m_data['Days'] . 'D');
        return $startDate->add($timeSpan);
    }

Usage Example

예제 #1
0
 public function has_section($p_sectionNumber)
 {
     $today = new Date(time());
     $subscriptionId = $this->m_dbObject->getSubscriptionId();
     $section = new SubscriptionSection($subscriptionId, $p_sectionNumber, 0);
     if ($section->exists() && $section->getExpirationDate() >= $today->getDate()) {
         return (int) true;
     }
     $currentLanguageNumber = CampTemplate::singleton()->context()->language->number;
     $section = new SubscriptionSection($subscriptionId, $p_sectionNumber, $currentLanguageNumber);
     return (int) ($section->exists() && $section->getExpirationDate() >= $today->getDate());
 }