Changeset View
Changeset View
Standalone View
Standalone View
src/applications/herald/field/HeraldField.php
Show First 20 Lines • Show All 171 Lines • ▼ Show 20 Lines | public function getEditorValue( | ||||
$value) { | $value) { | ||||
$value_type = $this->getHeraldFieldValueType($condition); | $value_type = $this->getHeraldFieldValueType($condition); | ||||
$value_type->setViewer($viewer); | $value_type->setViewer($viewer); | ||||
return $value_type->renderEditorValue($value); | return $value_type->renderEditorValue($value); | ||||
} | } | ||||
public function getPHIDsAffectedByCondition(HeraldCondition $condition) { | public function getPHIDsAffectedByCondition(HeraldCondition $condition) { | ||||
$phids = array(); | try { | ||||
$standard_type = $this->getHeraldFieldStandardType(); | $standard_type = $this->getHeraldFieldStandardType(); | ||||
} catch (PhutilMethodNotImplementedException $ex) { | |||||
$standard_type = null; | |||||
} | |||||
switch ($standard_type) { | switch ($standard_type) { | ||||
case self::STANDARD_PHID: | case self::STANDARD_PHID: | ||||
case self::STANDARD_PHID_NULLABLE: | case self::STANDARD_PHID_NULLABLE: | ||||
$phid = $condition->getValue(); | |||||
if ($phid) { | |||||
$phids[] = $phid; | |||||
} | |||||
break; | |||||
case self::STANDARD_PHID_LIST: | case self::STANDARD_PHID_LIST: | ||||
foreach ($condition->getValue() as $phid) { | $phids = $condition->getValue(); | ||||
$phids[] = $phid; | |||||
} | if (!is_array($phids)) { | ||||
break; | $phids = array(); | ||||
} | } | ||||
return $phids; | return $phids; | ||||
} | } | ||||
return array(); | |||||
} | |||||
final public function setAdapter(HeraldAdapter $adapter) { | final public function setAdapter(HeraldAdapter $adapter) { | ||||
$this->adapter = $adapter; | $this->adapter = $adapter; | ||||
return $this; | return $this; | ||||
} | } | ||||
final public function getAdapter() { | final public function getAdapter() { | ||||
return $this->adapter; | return $this->adapter; | ||||
} | } | ||||
Show All 35 Lines |