Code Duplication    Length = 5-5 lines in 6 locations

src/DataSource/DibiFluentDataSource.php 1 location

@@ 161-165 (lines=5) @@
158
		$or = [];
159
160
		foreach ($condition as $column => $value) {
161
			if ($filter->hasSplitWordsSearch() === FALSE) {
162
				$words = [$value];
163
			} else {
164
				$words = explode(' ', $value);
165
			}
166
167
			foreach ($words as $word) {
168
				$escaped = $this->data_source->getConnection()->getDriver()->escapeLike($word, 0);

src/DataSource/NetteDatabaseTableDataSource.php 1 location

@@ 170-174 (lines=5) @@
167
		$condition = $filter->getCondition();
168
169
		foreach ($condition as $column => $value) {
170
			if ($filter->hasSplitWordsSearch() === FALSE) {
171
				$words = [$value];
172
			} else {
173
				$words = explode(' ', $value);
174
			}
175
176
			$like = '(';
177
			$args = [];

src/DataSource/NextrasDataSource.php 1 location

@@ 181-185 (lines=5) @@
178
		$params = [];
179
180
		foreach ($condition as $column => $value) {
181
			if ($filter->hasSplitWordsSearch() === FALSE) {
182
				$words = [$value];
183
			} else {
184
				$words = explode(' ', $value);
185
			}
186
187
			foreach ($words as $word) {
188
				$expr .= "%column LIKE %s OR ";

src/DataSource/ArrayDataSource.php 1 location

@@ 154-158 (lines=5) @@
151
			$condition = $filter->getCondition();
152
153
			foreach ($condition as $column => $value) {
154
				if ($filter instanceof FilterText && $filter->hasSplitWordsSearch() === FALSE) {
155
					$words = [$value];
156
				} else {
157
					$words = explode(' ', $value);
158
				}
159
160
				$row_value = strtolower(Strings::toAscii($row[$column]));
161

src/DataSource/DoctrineCollectionDataSource.php 1 location

@@ 176-180 (lines=5) @@
173
		$exprs = [];
174
175
		foreach ($filter->getCondition() as $column => $value) {
176
			if ($filter->hasSplitWordsSearch() === FALSE) {
177
				$words = [$value];
178
			} else {
179
				$words = explode(' ', $value);
180
			}
181
182
			foreach ($words as $word) {
183
				$exprs[] = Criteria::expr()->contains($column, $word);

src/DataSource/DoctrineDataSource.php 1 location

@@ 234-238 (lines=5) @@
231
		$exprs = [];
232
233
		foreach ($condition as $column => $value) {
234
			if ($filter->hasSplitWordsSearch() === FALSE) {
235
				$words = [$value];
236
			} else {
237
				$words = explode(' ', $value);
238
			}
239
240
			$c = $this->checkAliases($column);
241