Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99247335
PonderAnswerStatusTransaction.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
Wed, Jan 22, 18:31
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jan 24, 18:31 (1 d, 21 h)
Engine
blob
Format
Raw Data
Handle
23755885
Attached To
rPH Phabricator
PonderAnswerStatusTransaction.php
View Options
<?php
final
class
PonderAnswerStatusTransaction
extends
PonderAnswerTransactionType
{
const
TRANSACTIONTYPE
=
'ponder.answer:status'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getStatus
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setStatus
(
$value
);
}
public
function
getTitle
()
{
$new
=
$this
->
getNewValue
();
if
(
$new
==
PonderAnswerStatus
::
ANSWER_STATUS_VISIBLE
)
{
return
pht
(
'%s marked this answer as visible.'
,
$this
->
renderAuthor
());
}
else
if
(
$new
==
PonderAnswerStatus
::
ANSWER_STATUS_HIDDEN
)
{
return
pht
(
'%s marked this answer as hidden.'
,
$this
->
renderAuthor
());
}
}
public
function
getTitleForFeed
()
{
$new
=
$this
->
getNewValue
();
if
(
$new
==
PonderAnswerStatus
::
ANSWER_STATUS_VISIBLE
)
{
return
pht
(
'%s marked %s as visible.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
else
if
(
$new
==
PonderAnswerStatus
::
ANSWER_STATUS_HIDDEN
)
{
return
pht
(
'%s marked %s as hidden.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
}
public
function
getIcon
()
{
$new
=
$this
->
getNewValue
();
if
(
$new
==
PonderAnswerStatus
::
ANSWER_STATUS_VISIBLE
)
{
return
'fa-ban'
;
}
else
if
(
$new
==
PonderAnswerStatus
::
ANSWER_STATUS_HIDDEN
)
{
return
'fa-check'
;
}
}
public
function
getColor
()
{
$new
=
$this
->
getNewValue
();
if
(
$new
==
PonderAnswerStatus
::
ANSWER_STATUS_VISIBLE
)
{
return
'green'
;
}
else
if
(
$new
==
PonderAnswerStatus
::
ANSWER_STATUS_HIDDEN
)
{
return
'indigo'
;
}
}
}
Event Timeline
Log In to Comment