You are here

protected function DeliveryCountryCondition::doEvaluate in Ubercart 8.4

Evaluates if the user's delivery address in one of the selected countries.

Parameters

\Drupal\uc_order\OrderInterface $order: The order.

array $countries: Array of 2-character country codes.

Return value

bool TRUE if the user delivery address is in one of the given countries.

File

uc_order/src/Plugin/Condition/DeliveryCountryCondition.php, line 98

Class

DeliveryCountryCondition
Provides an 'Order delivery country' condition.

Namespace

Drupal\uc_order\Plugin\Condition

Code

protected function doEvaluate(OrderInterface $order, array $countries = []) {
  return in_array($order
    ->getAddress('delivery')
    ->getCountry(), $countries);
}