interface AvailabilityCheckerInterface in Commerce Core 8.2
Same name in this branch
- 8.2 src/AvailabilityCheckerInterface.php \Drupal\commerce\AvailabilityCheckerInterface
- 8.2 modules/order/src/AvailabilityCheckerInterface.php \Drupal\commerce_order\AvailabilityCheckerInterface
Defines the interface for availability checkers.
Hierarchy
- interface \Drupal\commerce_order\AvailabilityCheckerInterface
Expanded class hierarchy of AvailabilityCheckerInterface
All classes that implement AvailabilityCheckerInterface
2 files declare their use of AvailabilityCheckerInterface
- AvailabilityManagerTest.php in modules/
order/ tests/ src/ Unit/ AvailabilityManagerTest.php - TestAvailabilityChecker.php in modules/
order/ tests/ modules/ commerce_order_test/ src/ TestAvailabilityChecker.php
File
- modules/
order/ src/ AvailabilityCheckerInterface.php, line 11
Namespace
Drupal\commerce_orderView source
interface AvailabilityCheckerInterface {
/**
* Determines whether the checker applies to the given order item.
*
* @param \Drupal\commerce_order\Entity\OrderItemInterface $order_item
* The order item.
*
* @return bool
* TRUE if the checker applies to the given order item, FALSE otherwise.
*/
public function applies(OrderItemInterface $order_item);
/**
* Checks the availability of the given order item.
*
* @param \Drupal\commerce_order\Entity\OrderItemInterface $order_item
* The order item.
* @param \Drupal\commerce\Context $context
* The context.
*
* @return \Drupal\commerce_order\AvailabilityResult
* The availability result. AvailabilityResult::unavailable() should be
* used to indicate that the given order item is "unavailable" for purchase.
* Note that an optional "reason" can be specified.
*/
public function check(OrderItemInterface $order_item, Context $context);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AvailabilityCheckerInterface:: |
public | function | Determines whether the checker applies to the given order item. | 1 |
AvailabilityCheckerInterface:: |
public | function | Checks the availability of the given order item. | 1 |