Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / almanac / xaction / AlmanacInterfaceDestroyTransaction.php
blob5e829ff3114beea44919f6cc42e8a4e5a66e6d74
1 <?php
3 final class AlmanacInterfaceDestroyTransaction
4 extends AlmanacInterfaceTransactionType {
6 const TRANSACTIONTYPE = 'almanac:interface:destroy';
8 public function generateOldValue($object) {
9 return false;
12 public function applyExternalEffects($object, $value) {
13 id(new PhabricatorDestructionEngine())
14 ->destroyObject($object);
17 public function validateTransactions($object, array $xactions) {
18 $errors = array();
20 if ($xactions) {
21 if ($object->loadIsInUse()) {
22 $errors[] = $this->newInvalidError(
23 pht(
24 'You can not delete this interface because it is currently in '.
25 'use. One or more services are bound to it.'));
29 return $errors;