Path: blob/master/src/applications/maniphest/herald/HeraldManiphestTaskAdapter.php
12256 views
<?php12final class HeraldManiphestTaskAdapter extends HeraldAdapter {34private $task;56protected function newObject() {7return new ManiphestTask();8}910public function getAdapterApplicationClass() {11return 'PhabricatorManiphestApplication';12}1314public function getAdapterContentDescription() {15return pht('React to tasks being created or updated.');16}1718public function isTestAdapterForObject($object) {19return ($object instanceof ManiphestTask);20}2122public function getAdapterTestDescription() {23return pht(24'Test rules which run when a task is created or updated.');25}2627protected function initializeNewAdapter() {28$this->task = $this->newObject();29}3031public function supportsApplicationEmail() {32return true;33}3435public function supportsRuleType($rule_type) {36switch ($rule_type) {37case HeraldRuleTypeConfig::RULE_TYPE_GLOBAL:38case HeraldRuleTypeConfig::RULE_TYPE_PERSONAL:39return true;40case HeraldRuleTypeConfig::RULE_TYPE_OBJECT:41default:42return false;43}44}4546public function setTask(ManiphestTask $task) {47$this->task = $task;48return $this;49}5051public function getTask() {52return $this->task;53}5455public function setObject($object) {56$this->task = $object;57return $this;58}5960public function getObject() {61return $this->task;62}6364public function getAdapterContentName() {65return pht('Maniphest Tasks');66}6768public function getHeraldName() {69return 'T'.$this->getTask()->getID();70}7172}737475