.. rst-class:: outdated
!DANGER!
We're sorry but this documentation section is outdated. Please have that in mind when trying to use it. You can help us making documentation up to date via Sylius Github. Thank you!
You can use it when your subject implements the :ref:`component_promotion_model_promotion-countable-subject-interface`:
<?php
$itemCountChecker = new ItemCountRuleChecker();
// a Subject that implements the CountablePromotionSubjectInterface
$subject->setQuantity(3);
$configuration = array('count' => 2);
$itemCountChecker->isEligible($subject, $configuration); // returns true
If your subject implements the :ref:`component_promotion_model_promotion-subject-interface` you can use it with this checker.
<?php
$itemTotalChecker = new ItemTotalRuleChecker();
// a Subject that implements the PromotionSubjectInterface
// Let's assume the subject->getSubjectItemTotal() returns 199
$configuration = array('amount' => 199);
$itemTotalChecker->isEligible($subject, $configuration); // returns true