Changeset View
Changeset View
Standalone View
Standalone View
src/applications/ponder/storage/PonderQuestionTransaction.php
<?php | <?php | ||||
final class PonderQuestionTransaction | final class PonderQuestionTransaction | ||||
extends PhabricatorApplicationTransaction { | extends PhabricatorApplicationTransaction { | ||||
const TYPE_TITLE = 'ponder.question:question'; | const TYPE_TITLE = 'ponder.question:question'; | ||||
const TYPE_CONTENT = 'ponder.question:content'; | const TYPE_CONTENT = 'ponder.question:content'; | ||||
const TYPE_ANSWERS = 'ponder.question:answer'; | const TYPE_ANSWERS = 'ponder.question:answer'; | ||||
const TYPE_STATUS = 'ponder.question:status'; | const TYPE_STATUS = 'ponder.question:status'; | ||||
const MAILTAG_DETAILS = 'question:details'; | |||||
const MAILTAG_COMMENT = 'question:comment'; | |||||
const MAILTAG_ANSWERS = 'question:answer'; | |||||
const MAILTAG_OTHER = 'question:other'; | |||||
public function getApplicationName() { | public function getApplicationName() { | ||||
return 'ponder'; | return 'ponder'; | ||||
} | } | ||||
public function getTableName() { | public function getTableName() { | ||||
return 'ponder_questiontransaction'; | return 'ponder_questiontransaction'; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 81 Lines • ▼ Show 20 Lines | switch ($this->getTransactionType()) { | ||||
'%s closed this question as a duplicate.', | '%s closed this question as a duplicate.', | ||||
$this->renderHandleLink($author_phid)); | $this->renderHandleLink($author_phid)); | ||||
} | } | ||||
} | } | ||||
return parent::getTitle(); | return parent::getTitle(); | ||||
} | } | ||||
public function getMailTags() { | |||||
$tags = parent::getMailTags(); | |||||
switch ($this->getTransactionType()) { | |||||
case PhabricatorTransactions::TYPE_COMMENT: | |||||
$tags[] = self::MAILTAG_COMMENT; | |||||
break; | |||||
case self::TYPE_TITLE: | |||||
case self::TYPE_CONTENT: | |||||
case self::TYPE_STATUS: | |||||
$tags[] = self::MAILTAG_DETAILS; | |||||
break; | |||||
case self::TYPE_ANSWERS: | |||||
$tags[] = self::MAILTAG_ANSWERS; | |||||
break; | |||||
default: | |||||
$tags[] = self::MAILTAG_OTHER; | |||||
break; | |||||
} | |||||
return $tags; | |||||
} | |||||
public function getIcon() { | public function getIcon() { | ||||
$old = $this->getOldValue(); | $old = $this->getOldValue(); | ||||
$new = $this->getNewValue(); | $new = $this->getNewValue(); | ||||
switch ($this->getTransactionType()) { | switch ($this->getTransactionType()) { | ||||
case self::TYPE_TITLE: | case self::TYPE_TITLE: | ||||
case self::TYPE_CONTENT: | case self::TYPE_CONTENT: | ||||
return 'fa-pencil'; | return 'fa-pencil'; | ||||
▲ Show 20 Lines • Show All 216 Lines • Show Last 20 Lines |