[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/fact/engine/ -> PhabricatorFactLastUpdatedEngine.php (source)

   1  <?php
   2  
   3  /**
   4   * Engine that records the time facts were last updated.
   5   */
   6  final class PhabricatorFactLastUpdatedEngine extends PhabricatorFactEngine {
   7  
   8    public function getFactSpecs(array $fact_types) {
   9      $results = array();
  10      foreach ($fact_types as $type) {
  11        if ($type == 'updated') {
  12          $results[] = id(new PhabricatorFactSimpleSpec($type))
  13            ->setName('Facts Last Updated')
  14            ->setUnit(PhabricatorFactSimpleSpec::UNIT_EPOCH);
  15        }
  16      }
  17      return $results;
  18    }
  19  
  20    public function shouldComputeAggregateFacts() {
  21      return true;
  22    }
  23  
  24    public function computeAggregateFacts() {
  25      $facts = array();
  26  
  27      $facts[] = id(new PhabricatorFactAggregate())
  28        ->setFactType('updated')
  29        ->setValueX(time());
  30  
  31      return $facts;
  32    }
  33  
  34  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1