Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F93206076
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
Wed, Nov 27, 00:37
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Nov 29, 00:37 (2 d)
Engine
blob
Format
Raw Data
Handle
22593567
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