DboSource::_mergeConditions PHP Method

_mergeConditions() protected method

Merges a mixed set of string/array conditions.
protected _mergeConditions ( mixed $query, mixed $assoc ) : array
$query mixed The query to merge conditions for.
$assoc mixed The association names.
return array
    protected function _mergeConditions($query, $assoc)
    {
        if (empty($assoc)) {
            return $query;
        }
        if (is_array($query)) {
            return array_merge((array) $assoc, $query);
        }
        if (!empty($query)) {
            $query = array($query);
            if (is_array($assoc)) {
                $query = array_merge($query, $assoc);
            } else {
                $query[] = $assoc;
            }
            return $query;
        }
        return $assoc;
    }
DboSource