Path: blob/master/src/applications/almanac/editor/AlmanacNamespaceEditor.php
12256 views
<?php12final class AlmanacNamespaceEditor3extends AlmanacEditor {45public function getEditorObjectsDescription() {6return pht('Almanac Namespace');7}89public function getCreateObjectTitle($author, $object) {10return pht('%s created this namespace.', $author);11}1213public function getCreateObjectTitleForFeed($author, $object) {14return pht('%s created %s.', $author, $object);15}1617protected function supportsSearch() {18return true;19}2021public function getTransactionTypes() {22$types = parent::getTransactionTypes();2324$types[] = PhabricatorTransactions::TYPE_VIEW_POLICY;25$types[] = PhabricatorTransactions::TYPE_EDIT_POLICY;2627return $types;28}2930protected function didCatchDuplicateKeyException(31PhabricatorLiskDAO $object,32array $xactions,33Exception $ex) {3435$errors = array();3637$errors[] = new PhabricatorApplicationTransactionValidationError(38null,39pht('Invalid'),40pht(41'Another namespace with this name already exists. Each namespace '.42'must have a unique name.'),43null);4445throw new PhabricatorApplicationTransactionValidationException($errors);46}4748}495051