Remove product literal strings in "pht()", part 6
[phabricator.git] / src / applications / policy / engineextension / PhabricatorPolicySearchEngineExtension.php
blob2b603bc95fbd1e8d6e31cc8feb8812cba98130c5
1 <?php
3 final class PhabricatorPolicySearchEngineExtension
4 extends PhabricatorSearchEngineExtension {
6 const EXTENSIONKEY = 'policy';
8 public function isExtensionEnabled() {
9 return true;
12 public function getExtensionName() {
13 return pht('Support for Policies');
16 public function supportsObject($object) {
17 return ($object instanceof PhabricatorPolicyInterface);
20 public function getExtensionOrder() {
21 return 6000;
24 public function getFieldSpecificationsForConduit($object) {
25 return array(
26 id(new PhabricatorConduitSearchFieldSpecification())
27 ->setKey('policy')
28 ->setType('map<string, wild>')
29 ->setDescription(pht('Map of capabilities to current policies.')),
33 public function getFieldValuesForConduit($object, $data) {
34 $capabilities = $object->getCapabilities();
36 $map = array();
37 foreach ($capabilities as $capability) {
38 $map[$capability] = $object->getPolicy($capability);
41 return array(
42 'policy' => $map,