You are here

public function AvailabilityCheckerInterface::check in Commerce Core 8.2

Same name in this branch
  1. 8.2 src/AvailabilityCheckerInterface.php \Drupal\commerce\AvailabilityCheckerInterface::check()
  2. 8.2 modules/order/src/AvailabilityCheckerInterface.php \Drupal\commerce_order\AvailabilityCheckerInterface::check()

Checks the availability of the given order item.

Parameters

\Drupal\commerce_order\Entity\OrderItemInterface $order_item: The order item.

\Drupal\commerce\Context $context: The context.

Return value

\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.

1 method overrides AvailabilityCheckerInterface::check()
TestAvailabilityChecker::check in modules/order/tests/modules/commerce_order_test/src/TestAvailabilityChecker.php
Checks the availability of the given order item.

File

modules/order/src/AvailabilityCheckerInterface.php, line 37

Class

AvailabilityCheckerInterface
Defines the interface for availability checkers.

Namespace

Drupal\commerce_order

Code

public function check(OrderItemInterface $order_item, Context $context);