Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1108873
PhabricatorSlowvoteQuestionTransaction.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
PhabricatorSlowvoteQuestionTransaction.php
View Options
<?php
final
class
PhabricatorSlowvoteQuestionTransaction
extends
PhabricatorSlowvoteTransactionType
{
const
TRANSACTIONTYPE
=
'vote:question'
;
public
function
generateOldValue
(
$object
)
{
return
$object
->
getQuestion
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setQuestion
(
$value
);
}
public
function
getTitle
()
{
$old
=
$this
->
getOldValue
();
$new
=
$this
->
getNewValue
();
if
(
$old
===
null
)
{
return
pht
(
'%s created this poll.'
,
$this
->
renderAuthor
());
}
else
{
return
pht
(
'%s changed the poll question from "%s" to "%s".'
,
$this
->
renderAuthor
(),
$old
,
$new
);
}
}
public
function
getTitleForFeed
()
{
$old
=
$this
->
getOldValue
();
if
(
$old
===
null
)
{
return
pht
(
'%s created %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
else
{
return
pht
(
'%s renamed %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
());
}
}
public
function
getIcon
()
{
$old
=
$this
->
getOldValue
();
if
(
$old
===
null
)
{
return
'fa-plus'
;
}
else
{
return
'fa-pencil'
;
}
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
();
if
(
$this
->
isEmptyTextTransaction
(
$object
->
getQuestion
(),
$xactions
))
{
$errors
[]
=
$this
->
newRequiredError
(
pht
(
'Polls must have a question.'
));
}
return
$errors
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, Jun 30, 10:03 PM (2 d)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
275922
Default Alt Text
PhabricatorSlowvoteQuestionTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment