You are here

protected function PurchasedEntityConditionBase::isValid in Commerce Core 8.2

Determines whether the given purchasable entity is "valid".

Parameters

\Drupal\commerce\PurchasableEntityInterface|null $purchasable_entity: The purchasable entity.

Return value

bool Whether the given purchasable entity is "valid".

2 calls to PurchasedEntityConditionBase::isValid()
OrderItemPurchasedEntity::evaluate in modules/order/src/Plugin/Commerce/Condition/OrderItemPurchasedEntity.php
Evaluates the condition.
OrderPurchasedEntity::evaluate in modules/order/src/Plugin/Commerce/Condition/OrderPurchasedEntity.php
Evaluates the condition.

File

modules/order/src/Plugin/Commerce/Condition/PurchasedEntityConditionBase.php, line 132

Class

PurchasedEntityConditionBase

Namespace

Drupal\commerce_order\Plugin\Commerce\Condition

Code

protected function isValid(PurchasableEntityInterface $purchasable_entity = NULL) : bool {
  return $purchasable_entity !== NULL && $purchasable_entity
    ->getEntityTypeId() === $this
    ->getPurchasableEntityType() && in_array($purchasable_entity
    ->uuid(), $this->configuration['entities'], TRUE);
}