Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93652323
PhameBlogStatusTransaction.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 30, 11:15
Size
1 KB
Mime Type
text/x-php
Expires
Mon, Dec 2, 11:15 (2 d)
Engine
blob
Format
Raw Data
Handle
22683762
Attached To
rPH Phabricator
PhameBlogStatusTransaction.php
View Options
<?php
final
class
PhameBlogStatusTransaction
extends
PhameBlogTransactionType
{
const
TRANSACTIONTYPE
=
'phame.blog.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
PhameBlog
::
STATUS_ACTIVE
:
return
pht
(
'%s published this blog.'
,
$this
->
renderAuthor
());
case
PhameBlog
::
STATUS_ARCHIVED
:
return
pht
(
'%s archived this blog.'
,
$this
->
renderAuthor
());
}
}
public
function
getTitleForFeed
()
{
$new
=
$this
->
getNewValue
();
switch
(
$new
)
{
case
PhameBlog
::
STATUS_ACTIVE
:
return
pht
(
'%s published the blog %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
case
PhameBlog
::
STATUS_ARCHIVED
:
return
pht
(
'%s archived the blog %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
}
public
function
getIcon
()
{
$new
=
$this
->
getNewValue
();
if
(
$new
==
PhameBlog
::
STATUS_ARCHIVED
)
{
return
'fa-ban'
;
}
else
{
return
'fa-check'
;
}
}
}
Event Timeline
Log In to Comment