Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F107418168
ManiphestTaskTitleTransaction.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
Tue, Apr 8, 01:53
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Apr 10, 01:53 (1 d, 7 h)
Engine
blob
Format
Raw Data
Handle
25385513
Attached To
rPH Phabricator
ManiphestTaskTitleTransaction.php
View Options
<?php
final
class
ManiphestTaskTitleTransaction
extends
ManiphestTaskTransactionType
{
const
TRANSACTIONTYPE
=
'title'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getTitle
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setTitle
(
$value
);
}
public
function
getActionStrength
()
{
return
1.4
;
}
public
function
getActionName
()
{
$old
=
$this
->
getOldValue
();
if
(!
strlen
(
$old
))
{
return
pht
(
'Created'
);
}
return
pht
(
'Retitled'
);
}
public
function
getTitle
()
{
$old
=
$this
->
getOldValue
();
if
(!
strlen
(
$old
))
{
return
pht
(
'%s created this task.'
,
$this
->
renderAuthor
());
}
return
pht
(
'%s renamed this task from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderOldValue
(),
$this
->
renderNewValue
());
}
public
function
getTitleForFeed
()
{
$old
=
$this
->
getOldValue
();
if
(
$old
===
null
)
{
return
pht
(
'%s created %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
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
->
getTitle
(),
$xactions
))
{
$errors
[]
=
$this
->
newRequiredError
(
pht
(
'Tasks must have a title.'
));
}
return
$errors
;
}
}
Event Timeline
Log In to Comment