public function MaestroIfTask::prepareTaskForSave in Maestro 8.2
Same name and namespace in other branches
- 3.x src/Plugin/EngineTasks/MaestroIfTask.php \Drupal\maestro\Plugin\EngineTasks\MaestroIfTask::prepareTaskForSave()
The specific task's manipulation of the values to save for a template save.
Parameters
array $form: The form.
\Drupal\Core\Form\FormStateInterface $form_state: The form's form state.
array $task: The fully loaded task array from the template.
Overrides MaestroEngineTaskInterface::prepareTaskForSave
File
- src/
Plugin/ EngineTasks/ MaestroIfTask.php, line 356
Class
- MaestroIfTask
- Maestro If Task Plugin.
Namespace
Drupal\maestro\Plugin\EngineTasksCode
public function prepareTaskForSave(array &$form, FormStateInterface $form_state, array &$task) {
// variable, operator, variable_value, status.
$method = $form_state
->getValue('method');
$byvariable = $form_state
->getValue('byvariable');
$bystatus = $form_state
->getValue('bystatus');
$task['data']['if'] = [
'method' => $method,
'variable' => $byvariable['variable'],
'operator' => $byvariable['operator'],
'variable_value' => $byvariable['variable_value'],
'status' => $bystatus['status'],
];
}