[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/infrastructure/customfield/standard/ -> PhabricatorStandardCustomFieldUsers.php (source)

   1  <?php
   2  
   3  final class PhabricatorStandardCustomFieldUsers
   4    extends PhabricatorStandardCustomFieldPHIDs {
   5  
   6    public function getFieldType() {
   7      return 'users';
   8    }
   9  
  10    public function renderEditControl(array $handles) {
  11      $value = $this->getFieldValue();
  12      if ($value) {
  13        $control_value = array_select_keys($handles, $value);
  14      } else {
  15        $control_value = array();
  16      }
  17  
  18      $control = id(new AphrontFormTokenizerControl())
  19        ->setLabel($this->getFieldName())
  20        ->setName($this->getFieldKey())
  21        ->setDatasource(new PhabricatorPeopleDatasource())
  22        ->setCaption($this->getCaption())
  23        ->setValue($control_value);
  24  
  25      $limit = $this->getFieldConfigValue('limit');
  26      if ($limit) {
  27        $control->setLimit($limit);
  28      }
  29  
  30      return $control;
  31    }
  32  
  33    public function appendToApplicationSearchForm(
  34      PhabricatorApplicationSearchEngine $engine,
  35      AphrontFormView $form,
  36      $value,
  37      array $handles) {
  38  
  39      $control = id(new AphrontFormTokenizerControl())
  40        ->setLabel($this->getFieldName())
  41        ->setName($this->getFieldKey())
  42        ->setDatasource(new PhabricatorPeopleDatasource())
  43        ->setValue($handles);
  44  
  45      $form->appendChild($control);
  46    }
  47  
  48    public function getHeraldFieldValueType($condition) {
  49      return HeraldAdapter::VALUE_USER;
  50    }
  51  
  52  }


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