Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101345264
AlmanacNetworkNameTransaction.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
Sat, Feb 8, 04:12
Size
1011 B
Mime Type
text/x-php
Expires
Mon, Feb 10, 04:12 (1 d, 20 h)
Engine
blob
Format
Raw Data
Handle
24140210
Attached To
rPH Phabricator
AlmanacNetworkNameTransaction.php
View Options
<?php
final
class
AlmanacNetworkNameTransaction
extends
AlmanacNetworkTransactionType
{
const
TRANSACTIONTYPE
=
'almanac:network:name'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getName
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setName
(
$value
);
}
public
function
getTitle
()
{
return
pht
(
'%s renamed this network from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderOldValue
(),
$this
->
renderNewValue
());
}
public
function
getTitleForFeed
()
{
return
pht
(
'%s renamed %s from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
(),
$this
->
renderOldValue
(),
$this
->
renderNewValue
());
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
();
if
(
$this
->
isEmptyTextTransaction
(
$object
->
getName
(),
$xactions
))
{
$errors
[]
=
$this
->
newRequiredError
(
pht
(
'Network name is required.'
));
}
return
$errors
;
}
}
Event Timeline
Log In to Comment