Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F486067
PhabricatorPasteTitleTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorPasteTitleTransaction.php
View Options
<?php
final
class
PhabricatorPasteTitleTransaction
extends
PhabricatorPasteTransactionType
{
const
TRANSACTIONTYPE
=
'paste.title'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getTitle
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setTitle
(
$value
);
}
public
function
getTitle
()
{
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
if
(
strlen
(
$old
)
&&
strlen
(
$new
))
{
return
pht
(
'%s changed the title of this paste from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderOldValue
(),
$this
->
renderNewValue
());
}
else
if
(
strlen
(
$new
))
{
return
pht
(
'%s changed the title of this paste from untitled to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderNewValue
());
}
else
{
return
pht
(
'%s changed the title of this paste from %s to untitled.'
,
$this
->
renderAuthor
(),
$this
->
renderOldValue
());
}
}
public
function
getTitleForFeed
()
{
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
if
(
strlen
(
$old
)
&&
strlen
(
$new
))
{
return
pht
(
'%s updated the title for %s from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
(),
$this
->
renderOldValue
(),
$this
->
renderNewValue
());
}
else
if
(
strlen
(
$new
))
{
return
pht
(
'%s updated the title for %s from untitled to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
(),
$this
->
renderNewValue
());
}
else
{
return
pht
(
'%s updated the title for %s from %s to untitled.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
(),
$this
->
renderOldValue
());
}
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Wed, May 7, 5:22 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
78878
Default Alt Text
PhabricatorPasteTitleTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment