Correct a parameter order swap in "diffusion.historyquery" for Mercurial
[phabricator.git] / src / applications / spaces / xaction / PhabricatorSpacesNamespaceDefaultTransaction.php
blobbc09b06d91b87a5c635bc4da8db7fbe631545fd4
1 <?php
3 final class PhabricatorSpacesNamespaceDefaultTransaction
4 extends PhabricatorSpacesNamespaceTransactionType {
6 const TRANSACTIONTYPE = 'spaces:default';
8 public function generateOldValue($object) {
9 return $object->getIsDefaultNamespace();
12 public function applyInternalEffects($object, $value) {
13 $object->setIsDefaultNamespace($value);
16 public function getTitle() {
17 return pht(
18 '%s made this the default space.',
19 $this->renderAuthor());
22 public function getTitleForFeed() {
23 return pht(
24 '%s made space %s the default space.',
25 $this->renderAuthor(),
26 $this->renderObject());
30 public function validateTransactions($object, array $xactions) {
31 $errors = array();
33 if (!$this->isNewObject()) {
34 foreach ($xactions as $xaction) {
35 $errors[] = $this->newInvalidError(
36 pht('Only the first space created can be the default space, and '.
37 'it must remain the default space evermore.'));
41 return $errors;