Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98673417
PhabricatorSlowvoteCloseTransaction.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 15, 12:41
Size
1 KB
Mime Type
text/x-php
Expires
Fri, Jan 17, 12:41 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23611887
Attached To
rPH Phabricator
PhabricatorSlowvoteCloseTransaction.php
View Options
<?php
final
class
PhabricatorSlowvoteCloseTransaction
extends
PhabricatorSlowvoteTransactionType
{
const
TRANSACTIONTYPE
=
'vote:close'
;
public
function
generateOldValue
(
$object
)
{
return
(
bool
)
$object
->
getIsClosed
();
}
public
function
generateNewValue
(
$object
,
$value
)
{
return
(
bool
)
$value
;
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setIsClosed
((
int
)
$value
);
}
public
function
getTitle
()
{
$new
=
$this
->
getNewValue
();
if
(
$new
)
{
return
pht
(
'%s closed this poll.'
,
$this
->
renderAuthor
());
}
else
{
return
pht
(
'%s reopened this poll.'
,
$this
->
renderAuthor
());
}
}
public
function
getTitleForFeed
()
{
$new
=
$this
->
getNewValue
();
if
(
$new
)
{
return
pht
(
'%s closed %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
else
{
return
pht
(
'%s reopened %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
}
public
function
getIcon
()
{
$new
=
$this
->
getNewValue
();
if
(
$new
)
{
return
'fa-ban'
;
}
else
{
return
'fa-pencil'
;
}
}
}
Event Timeline
Log In to Comment