Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93557082
PhabricatorSpacesNamespaceDefaultTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Nov 29, 17:30
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Dec 1, 17:30 (2 d)
Engine
blob
Format
Raw Data
Handle
22663707
Attached To
rPH Phabricator
PhabricatorSpacesNamespaceDefaultTransaction.php
View Options
<?php
final
class
PhabricatorSpacesNamespaceDefaultTransaction
extends
PhabricatorSpacesNamespaceTransactionType
{
const
TRANSACTIONTYPE
=
'spaces:default'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getIsDefaultNamespace
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setIsDefaultNamespace
(
$value
);
}
public
function
getTitle
()
{
return
pht
(
'%s made this the default space.'
,
$this
->
renderAuthor
());
}
public
function
getTitleForFeed
()
{
return
pht
(
'%s made space %s the default space.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
();
if
(!
$this
->
isNewObject
())
{
foreach
(
$xactions
as
$xaction
)
{
$errors
[]
=
$this
->
newInvalidError
(
pht
(
'Only the first space created can be the default space, and '
.
'it must remain the default space evermore.'
));
}
}
return
$errors
;
}
}
Event Timeline
Log In to Comment