@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
phorge
phabricator
1<?php
2
3final class PhortuneAccountEmailEditor
4 extends PhabricatorApplicationTransactionEditor {
5
6 public function getEditorApplicationClass() {
7 return PhabricatorPhortuneApplication::class;
8 }
9
10 public function getEditorObjectsDescription() {
11 return pht('Phortune Account Emails');
12 }
13
14 public function getCreateObjectTitle($author, $object) {
15 return pht('%s created this account email.', $author);
16 }
17
18 protected function didCatchDuplicateKeyException(
19 PhabricatorLiskDAO $object,
20 array $xactions,
21 Exception $ex) {
22
23 $errors = array();
24
25 $errors[] = new PhabricatorApplicationTransactionValidationError(
26 PhortuneAccountEmailAddressTransaction::TRANSACTIONTYPE,
27 pht('Duplicate'),
28 pht(
29 'The email address "%s" is already attached to this account.',
30 $object->getAddress()),
31 null);
32
33 throw new PhabricatorApplicationTransactionValidationException($errors);
34 }
35
36}