/**
* @see Rule::executeActions()
**/
function executeActions($output, $params)
{
if (count($this->actions)) {
foreach ($this->actions as $action) {
switch ($action->fields["action_type"]) {
case "assign":
$output[$action->fields["field"]] = $action->fields["value"];
break;
case "regex_result":
//Assign entity using the regex's result
if ($action->fields["field"] == "_affect_entity_by_tag") {
//Get the TAG from the regex's results
if (isset($this->regex_results[0])) {
$res = RuleAction::getRegexResultById($action->fields["value"], $this->regex_results[0]);
} else {
$res = $action->fields["value"];
}
if ($res != null) {
//Get the entity associated with the TAG
$target_entity = Entity::getEntityIDByTag($res);
if ($target_entity != '') {
$output["entities_id"] = $target_entity;
}
}
}
break;
}
}
}
return $output;
}