public function Promotion::getConditions in Commerce Core 8.2
Gets the conditions.
Return value
\Drupal\commerce\Plugin\Commerce\Condition\ConditionInterface[] The conditions.
Overrides PromotionInterface::getConditions
1 call to Promotion::getConditions()
- Promotion::applies in modules/
promotion/ src/ Entity/ Promotion.php - Checks whether the promotion can be applied to the given order.
File
- modules/
promotion/ src/ Entity/ Promotion.php, line 271
Class
- Promotion
- Defines the promotion entity class.
Namespace
Drupal\commerce_promotion\EntityCode
public function getConditions() {
$conditions = [];
foreach ($this
->get('conditions') as $field_item) {
/** @var \Drupal\commerce\Plugin\Field\FieldType\PluginItemInterface $field_item */
$condition = $field_item
->getTargetInstance();
if ($condition instanceof ParentEntityAwareInterface) {
$condition
->setParentEntity($this);
}
$conditions[] = $condition;
}
return $conditions;
}