OrderIsShippableCondition.php in Ubercart 8.4
Namespace
Drupal\uc_order\Plugin\ConditionFile
uc_order/src/Plugin/Condition/OrderIsShippableCondition.phpView source
<?php
namespace Drupal\uc_order\Plugin\Condition;
use Drupal\rules\Core\RulesConditionBase;
use Drupal\uc_order\OrderInterface;
/**
* Provides 'Order is shippable' condition.
*
* @Condition(
* id = "uc_order_condition_is_shippable",
* label = @Translation("Check if an order can be shipped"),
* category = @Translation("Order"),
* context_definitions = {
* "order" = @ContextDefinition("entity:uc_order",
* label = @Translation("Order")
* )
* }
* )
*/
class OrderIsShippableCondition extends RulesConditionBase {
/**
* {@inheritdoc}
*/
public function summary() {
return $this
->t("Check if an order can be shipped");
}
/**
* Evaluates if the the order is shippable.
*
* @param \Drupal\uc_order\OrderInterface $order
* The order.
*
* @return bool
* TRUE if the order is shippable.
*/
protected function doEvaluate(OrderInterface $order) {
return $order
->isShippable();
}
}
Classes
Name | Description |
---|---|
OrderIsShippableCondition | Provides 'Order is shippable' condition. |