protected function getJoinCswFields($reference) { $fields = array(); foreach ($reference as $k => $v) { if ($k === 'LOGIC') { continue; } if (is_numeric($k)) { $fields = array_merge($fields, $this->getJoinCswFields($v)); } else { // key $csw_result = \CSQLWhere::makeOperation($k); list($field, ) = array_values($csw_result); $fields[$field] = array('TABLE_ALIAS' => 'alias', 'FIELD_NAME' => $field, 'FIELD_TYPE' => 'string', 'MULTIPLE' => '', 'JOIN' => ''); // no need to add values as csw fields } } return $fields; }