Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/applications/almanac/engineextension/AlmanacPropertiesEditEngineExtension.php
12256 views
1
<?php
2
3
final class AlmanacPropertiesEditEngineExtension
4
extends PhabricatorEditEngineExtension {
5
6
const EXTENSIONKEY = 'almanac.properties';
7
8
public function isExtensionEnabled() {
9
return true;
10
}
11
12
public function getExtensionName() {
13
return pht('Almanac Properties');
14
}
15
16
public function supportsObject(
17
PhabricatorEditEngine $engine,
18
PhabricatorApplicationTransactionInterface $object) {
19
return ($object instanceof AlmanacPropertyInterface);
20
}
21
22
public function buildCustomEditFields(
23
PhabricatorEditEngine $engine,
24
PhabricatorApplicationTransactionInterface $object) {
25
26
return array(
27
id(new AlmanacSetPropertyEditField())
28
->setKey('property.set')
29
->setTransactionType($object->getAlmanacPropertySetTransactionType())
30
->setConduitDescription(
31
pht('Pass a map of values to set one or more properties.'))
32
->setConduitTypeDescription(pht('Map of property names to values.'))
33
->setIsFormField(false),
34
id(new AlmanacDeletePropertyEditField())
35
->setKey('property.delete')
36
->setTransactionType($object->getAlmanacPropertyDeleteTransactionType())
37
->setConduitDescription(
38
pht('Pass a list of property names to delete properties.'))
39
->setConduitTypeDescription(pht('List of property names.'))
40
->setIsFormField(false),
41
);
42
}
43
44
}
45
46