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

@@ 217-221 (lines=5) @@
214
		$exprs = [];
215
216
		foreach ($condition as $column => $value) {
217
			if ($filter->hasSplitWordsSearch() === FALSE) {
218
				$words = [$value];
219
			} else {
220
				$words = explode(' ', $value);
221
			}
222
223
			$c = $this->checkAliases($column);
224

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

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