[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

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

   1  <?php
   2  
   3  final class PhabricatorStandardCustomFieldText
   4    extends PhabricatorStandardCustomField {
   5  
   6    public function getFieldType() {
   7      return 'text';
   8    }
   9  
  10    public function buildFieldIndexes() {
  11      $indexes = array();
  12  
  13      $value = $this->getFieldValue();
  14      if (strlen($value)) {
  15        $indexes[] = $this->newStringIndex($value);
  16      }
  17  
  18      return $indexes;
  19    }
  20  
  21    public function readApplicationSearchValueFromRequest(
  22      PhabricatorApplicationSearchEngine $engine,
  23      AphrontRequest $request) {
  24  
  25      return $request->getStr($this->getFieldKey());
  26    }
  27  
  28    public function applyApplicationSearchConstraintToQuery(
  29      PhabricatorApplicationSearchEngine $engine,
  30      PhabricatorCursorPagedPolicyAwareQuery $query,
  31      $value) {
  32  
  33      if (strlen($value)) {
  34        $query->withApplicationSearchContainsConstraint(
  35          $this->newStringIndex(null),
  36          $value);
  37      }
  38    }
  39  
  40    public function appendToApplicationSearchForm(
  41      PhabricatorApplicationSearchEngine $engine,
  42      AphrontFormView $form,
  43      $value,
  44      array $handles) {
  45  
  46      $form->appendChild(
  47        id(new AphrontFormTextControl())
  48          ->setLabel($this->getFieldName())
  49          ->setName($this->getFieldKey())
  50          ->setValue($value));
  51    }
  52  
  53    public function shouldAppearInHerald() {
  54      return true;
  55    }
  56  
  57    public function getHeraldFieldConditions() {
  58      return array(
  59        HeraldAdapter::CONDITION_CONTAINS,
  60        HeraldAdapter::CONDITION_NOT_CONTAINS,
  61        HeraldAdapter::CONDITION_IS,
  62        HeraldAdapter::CONDITION_IS_NOT,
  63        HeraldAdapter::CONDITION_REGEXP,
  64      );
  65    }
  66  
  67  }


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