WellCommerce\Bundle\CouponBundle\Entity\CouponInterface::getValidTo PHP Méthode

getValidTo() public méthode

public getValidTo ( ) : DateTime | null
Résultat DateTime | null
    public function getValidTo();

Usage Example

 /**
  * Checks whether the coupon is not expired
  *
  * @param CouponInterface $coupon
  *
  * @return bool
  */
 private function isNotExpired(CouponInterface $coupon) : bool
 {
     $now = new \DateTime();
     $couponEndDate = $coupon->getValidTo();
     if ($couponEndDate instanceof \DateTime) {
         return $now <= $couponEndDate;
     }
     return true;
 }
All Usage Examples Of WellCommerce\Bundle\CouponBundle\Entity\CouponInterface::getValidTo