Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / nuance / xaction / NuanceSourceDefaultQueueTransaction.php
blobf5a7cc430284b6991ae33aa401c68fc139d7ce96
1 <?php
3 final class NuanceSourceDefaultQueueTransaction
4 extends NuanceSourceTransactionType {
6 const TRANSACTIONTYPE = 'source.queue.default';
8 public function generateOldValue($object) {
9 return $object->getDefaultQueuePHID();
12 public function applyInternalEffects($object, $value) {
13 $object->setDefaultQueuePHID($value);
16 public function getTitle() {
17 return pht(
18 '%s changed the default queue for this source from %s to %s.',
19 $this->renderAuthor(),
20 $this->renderOldHandle(),
21 $this->renderNewHandle());
24 public function validateTransactions($object, array $xactions) {
25 $errors = array();
27 if (!$object->getDefaultQueuePHID() && !$xactions) {
28 $errors[] = $this->newRequiredError(
29 pht('Sources must have a default queue.'));
32 foreach ($xactions as $xaction) {
33 if (!$xaction->getNewValue()) {
34 $errors[] = $this->newRequiredError(
35 pht('Sources must have a default queue.'));
39 return $errors;