3 final class PhabricatorRepositorySymbolSourcesTransaction
4 extends PhabricatorRepositoryTransactionType
{
6 const TRANSACTIONTYPE
= 'repo:symbol-source';
8 public function generateOldValue($object) {
9 return $object->getSymbolSources();
12 public function applyInternalEffects($object, $value) {
13 $object->setDetail('symbol-sources', $value);
16 public function getTitle() {
17 $old = $this->getOldValue();
18 $new = $this->getNewValue();
21 $display_old = $this->renderHandleList($old);
23 $display_old = $this->renderValue(pht('None'));
27 $display_new = $this->renderHandleList($new);
29 $display_new = $this->renderValue(pht('None'));
33 '%s changed symbol sources from %s to %s.',
34 $this->renderAuthor(),
39 public function validateTransactions($object, array $xactions) {
42 foreach ($xactions as $xaction) {
43 $old = $object->getSymbolSources();
44 $new = $xaction->getNewValue();
46 // If the viewer is adding new repositories, make sure they are
48 $add = array_diff($new, $old);
53 $repositories = id(new PhabricatorRepositoryQuery())
54 ->setViewer($this->getActor())
57 $repositories = mpull($repositories, null, 'getPHID');
59 foreach ($add as $phid) {
60 if (isset($repositories[$phid])) {
64 $errors[] = $this->newInvalidError(
66 'Repository ("%s") does not exist, or you do not have '.
67 'permission to see it.',