mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-16 11:52:40 +01:00
0a50219f1b
Summary: Ref T9964. This just adds more structure to application fields, to make it harder to make typos and easier to validate them later. Test Plan: Viewed APIs, called some APIs, saw good documentation and correct results. Reviewers: chad Reviewed By: chad Maniphest Tasks: T9964 Differential Revision: https://secure.phabricator.com/D14776
54 lines
1.3 KiB
PHP
54 lines
1.3 KiB
PHP
<?php
|
|
|
|
final class PhabricatorLiskSearchEngineExtension
|
|
extends PhabricatorSearchEngineExtension {
|
|
|
|
const EXTENSIONKEY = 'lisk';
|
|
|
|
public function isExtensionEnabled() {
|
|
return true;
|
|
}
|
|
|
|
public function getExtensionName() {
|
|
return pht('Lisk Builtin Properties');
|
|
}
|
|
|
|
public function getExtensionOrder() {
|
|
return 5000;
|
|
}
|
|
|
|
public function supportsObject($object) {
|
|
if (!($object instanceof LiskDAO)) {
|
|
return false;
|
|
}
|
|
|
|
if (!$object->getConfigOption(LiskDAO::CONFIG_TIMESTAMPS)) {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
public function getFieldSpecificationsForConduit($object) {
|
|
return array(
|
|
id(new PhabricatorConduitSearchFieldSpecification())
|
|
->setKey('dateCreated')
|
|
->setType('int')
|
|
->setDescription(
|
|
pht('Epoch timestamp when the object was created.')),
|
|
id(new PhabricatorConduitSearchFieldSpecification())
|
|
->setKey('dateModified')
|
|
->setType('int')
|
|
->setDescription(
|
|
pht('Epoch timestamp when the object was last updated.')),
|
|
);
|
|
}
|
|
|
|
public function getFieldValuesForConduit($object) {
|
|
return array(
|
|
'dateCreated' => (int)$object->getDateCreated(),
|
|
'dateModified' => (int)$object->getDateModified(),
|
|
);
|
|
}
|
|
|
|
}
|