Пример #1
0
 /**
  * If the code has a null usage limit it is considered to have unlimited usage.
  *
  * @return boolean
  */
 public function isActive(PromotionSubjectInterface $subject)
 {
     return $subject->getPromotionCode() == $this->code && ($this->usageLimitPerCode ? $subject->getPromotionUsageCount() < $this->usageLimitPerCode : true) && ($this->usageLimitPerUser ? $subject->getPromotionUserCount() < $this->usageLimitPerUser : true);
 }