Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93172997
PholioMockStatusTransaction.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, Nov 26, 18:34
Size
1 KB
Mime Type
text/x-php
Expires
Thu, Nov 28, 18:34 (2 d)
Engine
blob
Format
Raw Data
Handle
22586004
Attached To
rPH Phabricator
PholioMockStatusTransaction.php
View Options
<?php
final
class
PholioMockStatusTransaction
extends
PholioMockTransactionType
{
const
TRANSACTIONTYPE
=
'status'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getStatus
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setStatus
(
$value
);
}
public
function
getTitle
()
{
$new
=
$this
->
getNewValue
();
if
(
$new
==
PholioMock
::
STATUS_CLOSED
)
{
return
pht
(
'%s closed this mock.'
,
$this
->
renderAuthor
());
}
else
{
return
pht
(
'%s opened this mock.'
,
$this
->
renderAuthor
());
}
}
public
function
getTitleForFeed
()
{
$new
=
$this
->
getNewValue
();
if
(
$new
==
PholioMock
::
STATUS_CLOSED
)
{
return
pht
(
'%s closed mock %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
else
{
return
pht
(
'%s opened mock %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
}
public
function
getIcon
()
{
$new
=
$this
->
getNewValue
();
if
(
$new
==
PholioMock
::
STATUS_CLOSED
)
{
return
'fa-ban'
;
}
else
{
return
'fa-check'
;
}
}
public
function
getColor
()
{
$new
=
$this
->
getNewValue
();
if
(
$new
==
PholioMock
::
STATUS_CLOSED
)
{
return
PhabricatorTransactions
::
COLOR_INDIGO
;
}
else
{
return
PhabricatorTransactions
::
COLOR_GREEN
;
}
}
}
Event Timeline
Log In to Comment