Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/trigger/PhabricatorProjectTriggerRule.php
Show All 17 Lines | return id(new PhutilClassMapQuery()) | ||||
->setAncestorClass(__CLASS__) | ->setAncestorClass(__CLASS__) | ||||
->setUniqueMethod('getTriggerType') | ->setUniqueMethod('getTriggerType') | ||||
->execute(); | ->execute(); | ||||
} | } | ||||
final public function setRecord(PhabricatorProjectTriggerRuleRecord $record) { | final public function setRecord(PhabricatorProjectTriggerRuleRecord $record) { | ||||
$value = $record->getValue(); | $value = $record->getValue(); | ||||
$this->assertValidRuleValue($value); | $this->assertValidRuleRecordFormat($value); | ||||
$this->record = $record; | $this->record = $record; | ||||
return $this; | return $this; | ||||
} | } | ||||
final public function getRecord() { | final public function getRecord() { | ||||
return $this->record; | return $this->record; | ||||
} | } | ||||
final protected function getValue() { | final protected function getValue() { | ||||
return $this->getRecord()->getValue(); | return $this->getRecord()->getValue(); | ||||
} | } | ||||
protected function getValueForEditorField() { | protected function getValueForEditorField() { | ||||
return $this->getValue(); | return $this->getValue(); | ||||
} | } | ||||
abstract public function getSelectControlName(); | abstract public function getSelectControlName(); | ||||
abstract public function getRuleViewLabel(); | abstract public function getRuleViewLabel(); | ||||
abstract public function getRuleViewDescription($value); | abstract public function getRuleViewDescription($value); | ||||
abstract public function getRuleViewIcon($value); | abstract public function getRuleViewIcon($value); | ||||
abstract protected function assertValidRuleValue($value); | abstract protected function assertValidRuleRecordFormat($value); | ||||
final public function getRuleRecordValueValidationException() { | |||||
try { | |||||
$this->assertValidRuleRecordValue($this->getRecord()->getValue()); | |||||
} catch (Exception $ex) { | |||||
return $ex; | |||||
} | |||||
return null; | |||||
} | |||||
protected function assertValidRuleRecordValue($value) { | |||||
return; | |||||
} | |||||
abstract protected function newDropTransactions($object, $value); | abstract protected function newDropTransactions($object, $value); | ||||
abstract protected function newDropEffects($value); | abstract protected function newDropEffects($value); | ||||
abstract protected function getDefaultValue(); | abstract protected function getDefaultValue(); | ||||
abstract protected function getPHUIXControlType(); | abstract protected function getPHUIXControlType(); | ||||
abstract protected function getPHUIXControlSpecification(); | abstract protected function getPHUIXControlSpecification(); | ||||
protected function isSelectableRule() { | protected function isSelectableRule() { | ||||
return true; | return true; | ||||
▲ Show 20 Lines • Show All 101 Lines • Show Last 20 Lines |