3 final class PhabricatorCustomFieldEditEngineExtension
4 extends PhabricatorEditEngineExtension
{
6 const EXTENSIONKEY
= 'customfield.fields';
8 public function getExtensionPriority() {
12 public function isExtensionEnabled() {
16 public function getExtensionName() {
17 return pht('Custom Fields');
20 public function supportsObject(
21 PhabricatorEditEngine
$engine,
22 PhabricatorApplicationTransactionInterface
$object) {
23 return ($object instanceof PhabricatorCustomFieldInterface
);
26 public function newBulkEditGroups(PhabricatorEditEngine
$engine) {
28 id(new PhabricatorBulkEditGroup())
30 ->setLabel(pht('Custom Fields')),
34 public function buildCustomEditFields(
35 PhabricatorEditEngine
$engine,
36 PhabricatorApplicationTransactionInterface
$object) {
38 $viewer = $this->getViewer();
40 $field_list = PhabricatorCustomField
::getObjectFields(
42 PhabricatorCustomField
::ROLE_EDITENGINE
);
44 $field_list->setViewer($viewer);
46 if ($object->getID()) {
47 $field_list->readFieldsFromStorage($object);
51 foreach ($field_list->getFields() as $field) {
52 $edit_fields = $field->getEditEngineFields($engine);
53 foreach ($edit_fields as $edit_field) {
54 $group_key = $edit_field->getBulkEditGroupKey();
55 if ($group_key === null) {
56 $edit_field->setBulkEditGroupKey('custom');
59 $results[] = $edit_field;