Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/phabricator
Path: blob/master/src/infrastructure/customfield/field/PhabricatorCustomFieldAttachment.php
12242 views
1
<?php
2
3
/**
4
* Convenience class which simplifies the implementation of
5
* @{interface:PhabricatorCustomFieldInterface} by obscuring the details of how
6
* custom fields are stored.
7
*
8
* Generally, you should not use this class directly. It is used by
9
* @{class:PhabricatorCustomField} to manage field storage on objects.
10
*/
11
final class PhabricatorCustomFieldAttachment extends Phobject {
12
13
private $lists = array();
14
15
public function addCustomFieldList($role, PhabricatorCustomFieldList $list) {
16
$this->lists[$role] = $list;
17
return $this;
18
}
19
20
public function getCustomFieldList($role) {
21
if (empty($this->lists[$role])) {
22
throw new PhabricatorCustomFieldNotAttachedException(
23
pht(
24
"Role list '%s' is not available!",
25
$role));
26
}
27
return $this->lists[$role];
28
}
29
30
}
31
32