Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93517575
PonderQuestionStatusTransaction.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
Fri, Nov 29, 09:46
Size
2 KB
Mime Type
text/x-php
Expires
Sun, Dec 1, 09:46 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
22655132
Attached To
rPH Phabricator
PonderQuestionStatusTransaction.php
View Options
<?php
final
class
PonderQuestionStatusTransaction
extends
PonderQuestionTransactionType
{
const
TRANSACTIONTYPE
=
'ponder.question:status'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getStatus
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setStatus
(
$value
);
}
public
function
getTitle
()
{
$new
=
$this
->
getNewValue
();
switch
(
$new
)
{
case
PonderQuestionStatus
::
STATUS_OPEN
:
return
pht
(
'%s reopened this question.'
,
$this
->
renderAuthor
());
case
PonderQuestionStatus
::
STATUS_CLOSED_RESOLVED
:
return
pht
(
'%s closed this question as resolved.'
,
$this
->
renderAuthor
());
case
PonderQuestionStatus
::
STATUS_CLOSED_OBSOLETE
:
return
pht
(
'%s closed this question as obsolete.'
,
$this
->
renderAuthor
());
case
PonderQuestionStatus
::
STATUS_CLOSED_INVALID
:
return
pht
(
'%s closed this question as invalid.'
,
$this
->
renderAuthor
());
}
}
public
function
getTitleForFeed
()
{
$new
=
$this
->
getNewValue
();
switch
(
$new
)
{
case
PonderQuestionStatus
::
STATUS_OPEN
:
return
pht
(
'%s reopened %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
case
PonderQuestionStatus
::
STATUS_CLOSED_RESOLVED
:
return
pht
(
'%s closed %s as resolved.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
case
PonderQuestionStatus
::
STATUS_CLOSED_INVALID
:
return
pht
(
'%s closed %s as invalid.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
case
PonderQuestionStatus
::
STATUS_CLOSED_OBSOLETE
:
return
pht
(
'%s closed %s as obsolete.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
}
public
function
getIcon
()
{
$new
=
$this
->
getNewValue
();
return
PonderQuestionStatus
::
getQuestionStatusIcon
(
$new
);
}
public
function
getColor
()
{
$new
=
$this
->
getNewValue
();
return
PonderQuestionStatus
::
getQuestionStatusTagColor
(
$new
);
}
}
Event Timeline
Log In to Comment