[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/infrastructure/customfield/field/ -> PhabricatorCustomFieldAttachment.php (source)

   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 {
  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          "Role list '{$role}' is not available!");
  24      }
  25      return $this->lists[$role];
  26    }
  27  
  28  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1