Differential D20795 Diff 49586 src/applications/herald/engineextension/HeraldRuleIndexEngineExtension.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/herald/engineextension/HeraldRuleIndexEngineExtension.php
Show All 31 Lines | $rule = id(new HeraldRuleQuery()) | ||||
->needConditionsAndActions(true) | ->needConditionsAndActions(true) | ||||
->executeOne(); | ->executeOne(); | ||||
if (!$rule) { | if (!$rule) { | ||||
return array(); | return array(); | ||||
} | } | ||||
$phids = array(); | $phids = array(); | ||||
$fields = HeraldField::getAllFields(); | |||||
foreach ($rule->getConditions() as $condition_record) { | |||||
$field = idx($fields, $condition_record->getFieldName()); | |||||
if (!$field) { | |||||
continue; | |||||
} | |||||
$affected_phids = $field->getPHIDsAffectedByCondition($condition_record); | |||||
foreach ($affected_phids as $phid) { | |||||
$phids[] = $phid; | |||||
} | |||||
} | |||||
$actions = HeraldAction::getAllActions(); | $actions = HeraldAction::getAllActions(); | ||||
foreach ($rule->getActions() as $action_record) { | foreach ($rule->getActions() as $action_record) { | ||||
$action = idx($actions, $action_record->getAction()); | $action = idx($actions, $action_record->getAction()); | ||||
if (!$action) { | if (!$action) { | ||||
continue; | continue; | ||||
} | } | ||||
Show All 10 Lines |