You are here

public function AvailabilityResult::__construct in Commerce Core 8.2

Constructs a new AvailabilityResult object.

Parameters

bool $result: The availability result, FALSE when unavailable.

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

File

modules/order/src/AvailabilityResult.php, line 34

Class

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

Namespace

Drupal\commerce_order

Code

public function __construct($result, $reason = NULL) {
  assert(is_bool($result));
  assert(is_string($reason) || is_null($reason) || $reason instanceof MarkupInterface);
  $this->result = $result;
  $this->reason = $reason;
}