1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
builder.php
См. документацию.
1<?php
2
4
6
12{
14 private $entity;
15
17 private $content;
18
20 private $fieldName;
21
28 public function __construct(Entity\Base $entity, $fieldName)
29 {
30 $this->entity = $entity;
31 $this->fieldName = $fieldName;
32 }
33
39 public function isFullTextIndexEnabled()
40 {
41 return $this->entity->fullTextIndexEnabled($this->fieldName);
42 }
43
49 public function hasField()
50 {
51 return $this->entity->hasField($this->fieldName);
52 }
53
59 public function getContent()
60 {
61 if (!$this->content)
62 {
63 $this->content = new Content;
64 }
65
66 return $this->content;
67 }
68
74 public function isEnabled()
75 {
76 return $this->hasField() && $this->isFullTextIndexEnabled();
77 }
78
85 public function save($entityId)
86 {
87 $dataClass = $this->entity->getDataClass();
88 return $dataClass::update(
90 array($this->fieldName => $this->content->getString())
91 )->isSuccess();
92 }
93
101 public function applyFilter(array &$filter, $searchString)
102 {
103 if (!$searchString)
104 {
105 return false;
106 }
107 if (!$this->hasField())
108 {
109 return false;
110 }
111
112 $isFullTextEnabled = $this->isFullTextIndexEnabled();
113 $operation = $isFullTextEnabled ? '*' : '*%';
114 $filter["{$operation}{$this->fieldName}"] = Content::encodeText($searchString);
115
116 return true;
117 }
118}
__construct(Entity\Base $entity, $fieldName)
Определения builder.php:28
save($entityId)
Определения builder.php:85
isFullTextIndexEnabled()
Определения builder.php:39
applyFilter(array &$filter, $searchString)
Определения builder.php:101
static encodeText($text)
Определения content.php:32
$content
Определения commerceml.php:144
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$filter
Определения iblock_catalog_list.php:54
Определения ufield.php:9
Определения builder.php:3
$entityId
Определения payment.php:4