Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / infrastructure / customfield / engineextension / PhabricatorCustomFieldEditEngineExtension.php
blobcec665a03753083437ce5c59f1e30581e7794ae7
1 <?php
3 final class PhabricatorCustomFieldEditEngineExtension
4 extends PhabricatorEditEngineExtension {
6 const EXTENSIONKEY = 'customfield.fields';
8 public function getExtensionPriority() {
9 return 5000;
12 public function isExtensionEnabled() {
13 return true;
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) {
27 return array(
28 id(new PhabricatorBulkEditGroup())
29 ->setKey('custom')
30 ->setLabel(pht('Custom Fields')),
34 public function buildCustomEditFields(
35 PhabricatorEditEngine $engine,
36 PhabricatorApplicationTransactionInterface $object) {
38 $viewer = $this->getViewer();
40 $field_list = PhabricatorCustomField::getObjectFields(
41 $object,
42 PhabricatorCustomField::ROLE_EDITENGINE);
44 $field_list->setViewer($viewer);
46 if ($object->getID()) {
47 $field_list->readFieldsFromStorage($object);
50 $results = array();
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;
63 return $results;