Path: blob/master/src/applications/fact/storage/PhabricatorFactIntDatapoint.php
12256 views
<?php12final class PhabricatorFactIntDatapoint extends PhabricatorFactDAO {34protected $keyID;5protected $objectID;6protected $dimensionID;7protected $value;8protected $epoch;910private $key;11private $objectPHID;12private $dimensionPHID;1314protected function getConfiguration() {15return array(16self::CONFIG_TIMESTAMPS => false,17self::CONFIG_COLUMN_SCHEMA => array(18'id' => 'auto64',19'dimensionID' => 'id?',20'value' => 'sint64',21),22self::CONFIG_KEY_SCHEMA => array(23'key_dimension' => array(24'columns' => array('keyID', 'dimensionID'),25),26'key_object' => array(27'columns' => array('objectID'),28),29),30) + parent::getConfiguration();31}3233public function setKey($key) {34$this->key = $key;35return $this;36}3738public function getKey() {39return $this->key;40}4142public function setObjectPHID($object_phid) {43$this->objectPHID = $object_phid;44return $this;45}4647public function getObjectPHID() {48return $this->objectPHID;49}5051public function setDimensionPHID($dimension_phid) {52$this->dimensionPHID = $dimension_phid;53return $this;54}5556public function getDimensionPHID() {57return $this->dimensionPHID;58}5960public function newDatapointVector() {61return $this->formatVector(62array(63$this->key,64$this->objectPHID,65$this->dimensionPHID,66$this->value,67$this->epoch,68));69}7071public function newRawVector(array $spec) {72return $this->formatVector(73array(74$spec['key'],75$spec['objectPHID'],76$spec['dimensionPHID'],77$spec['value'],78$spec['epoch'],79));80}8182private function formatVector(array $vector) {83return implode(':', $vector);84}8586}878889