Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F92727229
PhabricatorPasteStatusTransaction.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, Nov 23, 04:44
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Nov 25, 04:44 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22498682
Attached To
rPH Phabricator
PhabricatorPasteStatusTransaction.php
View Options
<?php
final
class
PhabricatorPasteStatusTransaction
extends
PhabricatorPasteTransactionType
{
const
TRANSACTIONTYPE
=
'paste.status'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getStatus
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setStatus
(
$value
);
}
private
function
isActivate
()
{
return
(
$this
->
getNewValue
()
==
PhabricatorPaste
::
STATUS_ACTIVE
);
}
public
function
getIcon
()
{
if
(
$this
->
isActivate
())
{
return
'fa-check'
;
}
else
{
return
'fa-ban'
;
}
}
public
function
getColor
()
{
if
(
$this
->
isActivate
())
{
return
'green'
;
}
else
{
return
'indigo'
;
}
}
public
function
getTitle
()
{
if
(
$this
->
isActivate
())
{
return
pht
(
'%s activated this paste.'
,
$this
->
renderAuthor
());
}
else
{
return
pht
(
'%s archived this paste.'
,
$this
->
renderAuthor
());
}
}
public
function
getTitleForFeed
()
{
if
(
$this
->
isActivate
())
{
return
pht
(
'%s activated %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
else
{
return
pht
(
'%s archived %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
}
}
Event Timeline
Log In to Comment