@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at recaptime-dev/main 54 lines 1.3 kB view raw
1<?php 2 3final class PhabricatorLiskSearchEngineExtension 4 extends PhabricatorSearchEngineExtension { 5 6 const EXTENSIONKEY = 'lisk'; 7 8 public function isExtensionEnabled() { 9 return true; 10 } 11 12 public function getExtensionName() { 13 return pht('Lisk Builtin Properties'); 14 } 15 16 public function getExtensionOrder() { 17 return 5000; 18 } 19 20 public function supportsObject($object) { 21 if (!($object instanceof LiskDAO)) { 22 return false; 23 } 24 25 if (!$object->getConfigOption(LiskDAO::CONFIG_TIMESTAMPS)) { 26 return false; 27 } 28 29 return true; 30 } 31 32 public function getFieldSpecificationsForConduit($object) { 33 return array( 34 id(new PhabricatorConduitSearchFieldSpecification()) 35 ->setKey('dateCreated') 36 ->setType('int') 37 ->setDescription( 38 pht('Epoch timestamp when the object was created.')), 39 id(new PhabricatorConduitSearchFieldSpecification()) 40 ->setKey('dateModified') 41 ->setType('int') 42 ->setDescription( 43 pht('Epoch timestamp when the object was last updated.')), 44 ); 45 } 46 47 public function getFieldValuesForConduit($object, $data) { 48 return array( 49 'dateCreated' => (int)$object->getDateCreated(), 50 'dateModified' => (int)$object->getDateModified(), 51 ); 52 } 53 54}