Changeset View
Changeset View
Standalone View
Standalone View
src/applications/herald/adapter/HeraldAdapter.php
Show First 20 Lines • Show All 180 Lines • ▼ Show 20 Lines | public function getHeraldField($field_name) { | ||||
$impl = $this->getFieldImplementation($field_name); | $impl = $this->getFieldImplementation($field_name); | ||||
if ($impl) { | if ($impl) { | ||||
return $impl->getHeraldFieldValue($this->getObject()); | return $impl->getHeraldFieldValue($this->getObject()); | ||||
} | } | ||||
throw new Exception(pht("Unknown field '%s'!", $field_name)); | throw new Exception(pht("Unknown field '%s'!", $field_name)); | ||||
} | } | ||||
abstract public function applyHeraldEffects(array $effects); | public function applyHeraldEffects(array $effects) { | ||||
assert_instances_of($effects, 'HeraldEffect'); | |||||
$result = array(); | |||||
foreach ($effects as $effect) { | |||||
$result[] = $this->applyStandardEffect($effect); | |||||
} | |||||
return $result; | |||||
} | |||||
protected function handleCustomHeraldEffect(HeraldEffect $effect) { | protected function handleCustomHeraldEffect(HeraldEffect $effect) { | ||||
$custom_action = idx($this->getCustomActions(), $effect->getAction()); | $custom_action = idx($this->getCustomActions(), $effect->getAction()); | ||||
if ($custom_action !== null) { | if ($custom_action !== null) { | ||||
return $custom_action->applyEffect( | return $custom_action->applyEffect( | ||||
$this, | $this, | ||||
$this->getObject(), | $this->getObject(), | ||||
▲ Show 20 Lines • Show All 1,362 Lines • Show Last 20 Lines |