Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / infrastructure / customfield / standard / PhabricatorStandardCustomFieldText.php
blob56164bb7b5bf10d8581783b1db038808f7f40b2f
1 <?php
3 final class PhabricatorStandardCustomFieldText
4 extends PhabricatorStandardCustomField {
6 public function getFieldType() {
7 return 'text';
10 public function buildFieldIndexes() {
11 $indexes = array();
13 $value = $this->getFieldValue();
14 if (strlen($value)) {
15 $indexes[] = $this->newStringIndex($value);
18 return $indexes;
21 public function readApplicationSearchValueFromRequest(
22 PhabricatorApplicationSearchEngine $engine,
23 AphrontRequest $request) {
25 return $request->getStr($this->getFieldKey());
28 public function applyApplicationSearchConstraintToQuery(
29 PhabricatorApplicationSearchEngine $engine,
30 PhabricatorCursorPagedPolicyAwareQuery $query,
31 $value) {
33 if (strlen($value)) {
34 $query->withApplicationSearchContainsConstraint(
35 $this->newStringIndex(null),
36 $value);
40 public function appendToApplicationSearchForm(
41 PhabricatorApplicationSearchEngine $engine,
42 AphrontFormView $form,
43 $value) {
45 $form->appendChild(
46 id(new AphrontFormTextControl())
47 ->setLabel($this->getFieldName())
48 ->setName($this->getFieldKey())
49 ->setValue($value));
52 public function shouldAppearInHerald() {
53 return true;
56 public function getHeraldFieldConditions() {
57 return array(
58 HeraldAdapter::CONDITION_CONTAINS,
59 HeraldAdapter::CONDITION_NOT_CONTAINS,
60 HeraldAdapter::CONDITION_IS,
61 HeraldAdapter::CONDITION_IS_NOT,
62 HeraldAdapter::CONDITION_REGEXP,
63 HeraldAdapter::CONDITION_NOT_REGEXP,
67 public function getHeraldFieldStandardType() {
68 return HeraldField::STANDARD_TEXT;
71 protected function getHTTPParameterType() {
72 return new AphrontStringHTTPParameterType();
75 public function getConduitEditParameterType() {
76 return new ConduitStringParameterType();
79 protected function newExportFieldType() {
80 return new PhabricatorStringExportField();