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/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/NextrasDataSource.php 1 location

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

src/DataSource/DoctrineDataSource.php 1 location

@@ 227-231 (lines=5) @@
224
		$exprs = [];
225
226
		foreach ($condition as $column => $value) {
227
			if ($filter->hasSplitWordsSearch() === FALSE) {
228
				$words = [$value];
229
			} else {
230
				$words = explode(' ', $value);
231
			}
232
233
			$c = $this->checkAliases($column);
234