Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F559775
PhabricatorCountdownEpochTransaction.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
PhabricatorCountdownEpochTransaction.php
View Options
<?php
final
class
PhabricatorCountdownEpochTransaction
extends
PhabricatorCountdownTransactionType
{
const
TRANSACTIONTYPE
=
'countdown:epoch'
;
public
function
generateOldValue
(
$object
)
{
return
(
int
)
$object
->
getEpoch
();
}
public
function
generateNewValue
(
$object
,
$value
)
{
return
$value
->
newPhutilDateTime
()
->
newAbsoluteDateTime
()
->
getEpoch
();
}
public
function
applyInternalEffects
(
$object
,
$value
)
{
$object
->
setEpoch
(
$value
);
}
public
function
getTitle
()
{
return
pht
(
'%s updated the countdown end from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderOldDate
(),
$this
->
renderNewDate
());
}
public
function
getTitleForFeed
()
{
return
pht
(
'%s updated the countdown end for %s from %s to %s.'
,
$this
->
renderAuthor
(),
$this
->
renderObject
(),
$this
->
renderOldDate
(),
$this
->
renderNewDate
());
}
public
function
validateTransactions
(
$object
,
array
$xactions
)
{
$errors
=
array
();
if
(!
$object
->
getEpoch
()
&&
!
$xactions
)
{
$errors
[]
=
$this
->
newRequiredError
(
pht
(
'You must give the countdown an end date.'
));
return
$errors
;
}
foreach
(
$xactions
as
$xaction
)
{
$value
=
$xaction
->
getNewValue
();
if
(!
$value
->
isValid
())
{
$errors
[]
=
$this
->
newInvalidError
(
pht
(
'You must give the countdown an end date.'
));
}
}
return
$errors
;
}
}
File Metadata
Details
Attached
Mime Type
text/x-php
Expires
Mon, May 12, 10:43 PM (1 d, 23 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
122152
Default Alt Text
PhabricatorCountdownEpochTransaction.php (1 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment