Eccube\Entity\OrderDetail::isEffective PHP Метод

isEffective() публичный Метод

public isEffective ( Eccube\Entity\BaseInfo $BaseInfo ) : boolean
$BaseInfo Eccube\Entity\BaseInfo
Результат boolean
    public function isEffective(\Eccube\Entity\BaseInfo $BaseInfo)
    {
        $downloable = clone $this->getOrder()->getPaymentDate();
        if ($BaseInfo->getDownloadableDays()) {
            $downloable->add(new \DateInterval("P" . $BaseInfo->getDownloadableDays() . "D"));
        }
        if ($BaseInfo->getDownloadableDaysUnlimited() === 1 && $this->getOrder()->getPaymentDate()) {
            return true;
        } elseif (new \DateTime() <= $downloable) {
            return true;
        } else {
            return false;
        }
    }