Code Duplication    Length = 3-5 lines in 2 locations

app/Plugin/Search/Controller/Component/PrgComponent.php 1 location

@@ 240-244 (lines=5) @@
237
	public function serializeParams(array &$data) {
238
		foreach ($this->controller->presetVars as $field) {
239
			if ($field['type'] === 'checkbox') {
240
				if (array_key_exists($field['field'], $data)) {
241
					$values = join('|', (array)$data[$field['field']]);
242
				} else {
243
					$values = '';
244
				}
245
				$data[$field['field']] = $values;
246
			}
247

app/Plugin/Search/Model/Behavior/SearchableBehavior.php 1 location

@@ 76-78 (lines=3) @@
73
		$conditions = array();
74
		foreach ($Model->filterArgs as $field) {
75
			// If this field was not passed and a default value exists, use that instead.
76
			if (!array_key_exists($field['name'], $data) && array_key_exists('defaultValue', $field)) {
77
				$data[$field['name']] = $field['defaultValue'];
78
			}
79
80
			if (in_array($field['type'], array('like'))) {
81
				$this->_addCondLike($Model, $conditions, $data, $field);