Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/customfield/field/PhabricatorCustomField.php
| Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | try { | ||||
| $spec = $object->getCustomFieldSpecificationForRole($role); | $spec = $object->getCustomFieldSpecificationForRole($role); | ||||
| if (!is_array($spec)) { | if (!is_array($spec)) { | ||||
| $obj_class = get_class($object); | $obj_class = get_class($object); | ||||
| throw new Exception( | throw new Exception( | ||||
| "Expected an array from getCustomFieldSpecificationForRole() for ". | "Expected an array from getCustomFieldSpecificationForRole() for ". | ||||
| "object of class '{$obj_class}'."); | "object of class '{$obj_class}'."); | ||||
| } | } | ||||
| $fields = PhabricatorCustomField::buildFieldList( | $fields = self::buildFieldList( | ||||
| $base_class, | $base_class, | ||||
| $spec, | $spec, | ||||
| $object); | $object); | ||||
| foreach ($fields as $key => $field) { | foreach ($fields as $key => $field) { | ||||
| if (!$field->shouldEnableForRole($role)) { | if (!$field->shouldEnableForRole($role)) { | ||||
| unset($fields[$key]); | unset($fields[$key]); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 1,305 Lines • Show Last 20 Lines | |||||