Code Duplication    Length = 5-5 lines in 6 locations

src/DataSource/ArrayDataSource.php 1 location

@@ 164-168 (lines=5) @@
161
					return $row[$column] == $value;
162
				}
163
164
				if ($filter instanceof FilterText && $filter->hasSplitWordsSearch() === FALSE) {
165
					$words = [$value];
166
				} else {
167
					$words = explode(' ', $value);
168
				}
169
170
				$row_value = strtolower(Strings::toAscii($row[$column]));
171

src/DataSource/DibiFluentDataSource.php 1 location

@@ 179-183 (lines=5) @@
176
				continue;
177
			}
178
179
			if ($filter->hasSplitWordsSearch() === FALSE) {
180
				$words = [$value];
181
			} else {
182
				$words = explode(' ', $value);
183
			}
184
185
			foreach ($words as $word) {
186
				$escaped = $this->data_source->getConnection()->getDriver()->escapeLike($word, 0);

src/DataSource/NetteDatabaseTableDataSource.php 1 location

@@ 184-188 (lines=5) @@
181
				$like .=  "$column = ? OR ";
182
				$args[] = "$value";
183
			} else {
184
				if ($filter->hasSplitWordsSearch() === FALSE) {
185
					$words = [$value];
186
				} else {
187
					$words = explode(' ', $value);
188
				}
189
				foreach ($words as $word) {
190
					$like .= "$column LIKE ? OR ";
191
					$args[] = "%$word%";

src/DataSource/NextrasDataSource.php 1 location

@@ 195-199 (lines=5) @@
192
				continue;
193
			}
194
195
			if ($filter->hasSplitWordsSearch() === FALSE) {
196
				$words = [$value];
197
			} else {
198
				$words = explode(' ', $value);
199
			}
200
201
			foreach ($words as $word) {
202
				$expr .= "%column LIKE %s OR ";

src/DataSource/DoctrineCollectionDataSource.php 1 location

@@ 185-189 (lines=5) @@
182
				continue;
183
			}
184
185
			if ($filter->hasSplitWordsSearch() === FALSE) {
186
				$words = [$value];
187
			} else {
188
				$words = explode(' ', $value);
189
			}
190
191
			foreach ($words as $word) {
192
				$exprs[] = Criteria::expr()->contains($column, $word);

src/DataSource/DoctrineDataSource.php 1 location

@@ 243-247 (lines=5) @@
240
				continue;
241
			}
242
243
			if ($filter->hasSplitWordsSearch() === FALSE) {
244
				$words = [$value];
245
			} else {
246
				$words = explode(' ', $value);
247
			}
248
249
			foreach ($words as $word) {
250
				$exprs[] = $this->data_source->expr()->like($c, $this->data_source->expr()->literal("%$word%"));