mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-02 11:42:42 +01:00
4dc8e2de56
Summary: See discussion in D19379. The 4-tuple of (device, network, address, port) should be unique. Test Plan: Created lots of duplicate interfaces, bound those interfaces to various services, observed migration script clean things up correctly. Reviewers: epriestley Reviewed By: epriestley Subscribers: Korvin, PHID-OPKG-gm6ozazyms6q6i22gyam Differential Revision: https://secure.phabricator.com/D19388
36 lines
872 B
PHP
36 lines
872 B
PHP
<?php
|
|
|
|
final class AlmanacInterfaceEditor
|
|
extends AlmanacEditor {
|
|
|
|
public function getEditorObjectsDescription() {
|
|
return pht('Almanac Interface');
|
|
}
|
|
|
|
public function getCreateObjectTitle($author, $object) {
|
|
return pht('%s created this interface.', $author);
|
|
}
|
|
|
|
public function getCreateObjectTitleForFeed($author, $object) {
|
|
return pht('%s created %s.', $author, $object);
|
|
}
|
|
|
|
protected function didCatchDuplicateKeyException(
|
|
PhabricatorLiskDAO $object,
|
|
array $xactions,
|
|
Exception $ex) {
|
|
|
|
$errors = array();
|
|
|
|
$errors[] = new PhabricatorApplicationTransactionValidationError(
|
|
null,
|
|
pht('Invalid'),
|
|
pht(
|
|
'Interfaces must have a unique combination of network, device, '.
|
|
'address, and port.'),
|
|
null);
|
|
|
|
throw new PhabricatorApplicationTransactionValidationException($errors);
|
|
}
|
|
|
|
}
|