3 final class DifferentialActionEmailCommand
4 extends MetaMTAEmailTransactionCommand
{
9 private $commandSummary;
10 private $commandDescription;
12 public function getCommand() {
13 return $this->command
;
16 private function setCommand($command) {
17 $this->command
= $command;
21 private function setAction($action) {
22 $this->action
= $action;
26 private function getAction() {
30 private function setCommandAliases(array $aliases) {
31 $this->aliases
= $aliases;
35 public function getCommandAliases() {
36 return $this->aliases
;
39 public function setCommandSummary($command_summary) {
40 $this->commandSummary
= $command_summary;
44 public function getCommandSummary() {
45 return $this->commandSummary
;
48 public function setCommandDescription($command_description) {
49 $this->commandDescription
= $command_description;
53 public function getCommandDescription() {
54 return $this->commandDescription
;
57 public function getCommandObjects() {
58 $actions = DifferentialRevisionActionTransaction
::loadAllActions();
59 $actions = msortv($actions, 'getRevisionActionOrderVector');
62 foreach ($actions as $action) {
63 $keyword = $action->getCommandKeyword();
64 if ($keyword === null) {
68 $aliases = $action->getCommandAliases();
69 $summary = $action->getCommandSummary();
71 $object = id(new self())
72 ->setCommand($keyword)
73 ->setCommandAliases($aliases)
74 ->setAction($action->getTransactionTypeConstant())
75 ->setCommandSummary($summary);
83 public function isCommandSupportedForObject(
84 PhabricatorApplicationTransactionInterface
$object) {
85 return ($object instanceof DifferentialRevision
);
88 public function buildTransactions(
89 PhabricatorUser
$viewer,
90 PhabricatorApplicationTransactionInterface
$object,
91 PhabricatorMetaMTAReceivedMail
$mail,
96 $xactions[] = $object->getApplicationTransactionTemplate()
97 ->setTransactionType($this->getAction())