Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F106647072
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
Sat, Mar 29, 08:05
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Mar 31, 09:05 (2 d)
Engine
blob
Format
Raw Data
Handle
25244055
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