Changeset View
Changeset View
Standalone View
Standalone View
src/applications/badges/editor/PhabricatorBadgesEditor.php
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Lines | final class PhabricatorBadgesEditor | ||||
} | } | ||||
protected function shouldPublishFeedStory( | protected function shouldPublishFeedStory( | ||||
PhabricatorLiskDAO $object, | PhabricatorLiskDAO $object, | ||||
array $xactions) { | array $xactions) { | ||||
return true; | return true; | ||||
} | } | ||||
protected function expandTransactions( | |||||
PhabricatorLiskDAO $object, | |||||
array $xactions) { | |||||
$actor = $this->getActor(); | |||||
$actor_phid = $actor->getPHID(); | |||||
$results = parent::expandTransactions($object, $xactions); | |||||
// Automatically subscribe the author when they create a badge. | |||||
if ($this->getIsNewObject()) { | |||||
if ($actor_phid) { | |||||
$results[] = id(new PhabricatorBadgesTransaction()) | |||||
->setTransactionType(PhabricatorTransactions::TYPE_SUBSCRIBERS) | |||||
->setNewValue( | |||||
array( | |||||
'+' => array($actor_phid => $actor_phid), | |||||
)); | |||||
} | |||||
} | |||||
return $results; | |||||
} | |||||
protected function buildReplyHandler(PhabricatorLiskDAO $object) { | protected function buildReplyHandler(PhabricatorLiskDAO $object) { | ||||
return id(new PhabricatorBadgesReplyHandler()) | return id(new PhabricatorBadgesReplyHandler()) | ||||
->setMailReceiver($object); | ->setMailReceiver($object); | ||||
} | } | ||||
protected function buildMailTemplate(PhabricatorLiskDAO $object) { | protected function buildMailTemplate(PhabricatorLiskDAO $object) { | ||||
$name = $object->getName(); | $name = $object->getName(); | ||||
$id = $object->getID(); | $id = $object->getID(); | ||||
Show All 37 Lines |