public function check(Discount $discount) { if ($discount->UseLimit) { if ($discount->getUseCount($this->order->ID) >= $discount->UseLimit) { $this->error("This discount has reached it's maximum number of uses."); return false; } } return true; }