public function FillEntityVariableFields::getAvailableEmptyVariables in Business Rules 8
Same name and namespace in other branches
- 2.x src/Plugin/BusinessRulesAction/FillEntityVariableFields.php \Drupal\business_rules\Plugin\BusinessRulesAction\FillEntityVariableFields::getAvailableEmptyVariables()
Get the available empty variables for the context.
Parameters
\Drupal\business_rules\Entity\Action $item: The action object.
Return value
array Array of available variables.
1 call to FillEntityVariableFields::getAvailableEmptyVariables()
- FillEntityVariableFields::getSettingsForm in src/
Plugin/ BusinessRulesAction/ FillEntityVariableFields.php - Return the form array.
File
- src/
Plugin/ BusinessRulesAction/ FillEntityVariableFields.php, line 254
Class
- FillEntityVariableFields
- Class FillEntityVariableFields.
Namespace
Drupal\business_rules\Plugin\BusinessRulesActionCode
public function getAvailableEmptyVariables(Action $item) {
$variables = Variable::loadMultiple();
$output = [];
/** @var \Drupal\business_rules\Entity\Variable $variable */
foreach ($variables as $variable) {
if ($item
->getTargetEntityType() == $variable
->getTargetEntityType() && $item
->getTargetBundle() == $variable
->getTargetBundle() && $variable
->getType() == 'entity_empty_variable') {
$output[$variable
->id()] = $variable
->label() . ' [' . $variable
->id() . ']';
}
}
return $output;
}