You are here

public static function AvailabilityResult::unavailable in Commerce Core 8.2

Creates an availability result that is "unavailable".

Parameters

string $reason: (optional) The reason why an order item is unavailable.

Return value

static

5 calls to AvailabilityResult::unavailable()
AvailabilityManager::check in modules/order/src/AvailabilityManager.php
Checks the availability of the given order item.
AvailabilityManagerTest::testCheck in modules/order/tests/src/Unit/AvailabilityManagerTest.php
::covers addChecker ::covers check.
AvailabilityManagerTest::testLegacyCheckers in modules/order/tests/src/Unit/AvailabilityManagerTest.php
::covers addChecker ::covers addLegacyChecker ::covers check.
PurchasedEntityConstraintValidatorTest::dataProviderCheckerData in modules/order/tests/src/Kernel/PurchasedEntityConstraintValidatorTest.php
Data provider for test.
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/AvailabilityResult.php, line 58

Class

AvailabilityResult
Provides a value object representing the "availability" of an order item.

Namespace

Drupal\commerce_order

Code

public static function unavailable($reason = NULL) : AvailabilityResult {
  return new static(FALSE, $reason);
}