You are here

public function TestAvailabilityChecker::check in Commerce Core 8.2

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.

Overrides AvailabilityCheckerInterface::check

File

modules/order/tests/modules/commerce_order_test/src/TestAvailabilityChecker.php, line 27

Class

TestAvailabilityChecker
Test availability checker.

Namespace

Drupal\commerce_order_test

Code

public function check(OrderItemInterface $order_item, Context $context) {
  return AvailabilityResult::unavailable();
}