Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F106109912
PhabricatorFactLastUpdatedEngine.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, Mar 22, 13:11
Size
778 B
Mime Type
text/x-php
Expires
Mon, Mar 24, 13:11 (2 d)
Engine
blob
Format
Raw Data
Handle
25101532
Attached To
rPH Phabricator
PhabricatorFactLastUpdatedEngine.php
View Options
<?php
/**
* Engine that records the time facts were last updated.
*/
final
class
PhabricatorFactLastUpdatedEngine
extends
PhabricatorFactEngine
{
public
function
getFactSpecs
(
array
$fact_types
)
{
$results
=
array
();
foreach
(
$fact_types
as
$type
)
{
if
(
$type
==
'updated'
)
{
$results
[]
=
id
(
new
PhabricatorFactSimpleSpec
(
$type
))
->
setName
(
pht
(
'Facts Last Updated'
))
->
setUnit
(
PhabricatorFactSimpleSpec
::
UNIT_EPOCH
);
}
}
return
$results
;
}
public
function
shouldComputeAggregateFacts
()
{
return
true
;
}
public
function
computeAggregateFacts
()
{
$facts
=
array
();
$facts
[]
=
id
(
new
PhabricatorFactAggregate
())
->
setFactType
(
'updated'
)
->
setValueX
(
time
());
return
$facts
;
}
}
Event Timeline
Log In to Comment