protected function processCondition($conditions, $params, $types)
    {
        // Regard numeric and null as primary key value
        if (is_numeric($conditions) || empty($conditions)) {
            $conditions = array($this->primaryKey => $conditions);
        }

        if (is_array($conditions)) {
            $where = array();
            $params = array();
            foreach ($conditions as $field => $condition) {
                if (is_array($condition)) {
                    $where[] = $field . ' IN (' . implode(', ', array_pad(array(), count($condition), '?')) . ')';
                    $params = array_merge($params, $condition);
                } else {
                    $where[] = $field . " = ?";
                    $params[] = $condition;
                }
            }
            $conditions = implode(' AND ', $where);
        }

        if ($params !== false) {
            if (is_array($params)) {
                $this->params = array_merge($this->params, $params);
                $this->paramTypes = array_merge($this->paramTypes, $types);
            } else {
                $this->params[] = $params;
                if ($types) {
                    $this->paramTypes[] = $types;
                }
            }
        }

        return $conditions;
    }
protected function processCondition($conditions, $params, $types)
    {
        // Regard numeric and null as primary key value
        if (is_numeric($conditions) || empty($conditions)) {
            $conditions = array($this->primaryKey => $conditions);
        }

        if (is_array($conditions)) {
            $where = array();
            $params = array();
            foreach ($conditions as $field => $condition) {
                if (is_array($condition)) {
                    $where[] = $field . ' IN (' . implode(', ', array_pad(array(), count($condition), '?')) . ')';
                    $params = array_merge($params, $condition);
                } else {
                    $where[] = $field . " = ?";
                    $params[] = $condition;
                }
            }
            $conditions = implode(' AND ', $where);
        }

        if ($params !== false) {
            if (is_array($params)) {
                $this->params = array_merge($this->params, $params);
                $this->paramTypes = array_merge($this->paramTypes, $types);
            } else {
                $this->params[] = $params;
                if ($types) {
                    $this->paramTypes[] = $types;
                }
            }
        }

        return $conditions;
    }
protected function processCondition ( $ conditions , $ params , $ types ) { // Regard numeric and null as primary key value if ( is_numeric ( $ conditions ) || empty ( $ conditions ) ) { $ conditions = array ( $ this -> primaryKey => $ conditions ) ; } if ( is_array ( $ conditions ) ) { $ where = array ( ) ; $ params = array ( ) ; foreach ( $ conditions as $ field => $ condition ) { if ( is_array ( $ condition ) ) { $ where [ ] = $ field . ' IN (' . implode ( ', ' , array_pad ( array ( ) , count ( $ condition ) , '?' ) ) . ')' ; $ params = array_merge ( $ params , $ condition ) ; } else { $ where [ ] = $ field . " = ?" ; $ params [ ] = $ condition ; } } $ conditions = implode ( ' AND ' , $ where ) ; } if ( $ params !== false ) { if ( is_array ( $ params ) ) { $ this -> params = array_merge ( $ this -> params , $ params ) ; $ this -> paramTypes = array_merge ( $ this -> paramTypes , $ types ) ; } else { $ this -> params [ ] = $ params ; if ( $ types ) { $ this -> paramTypes [ ] = $ types ; } } } return $ conditions ; }
Generate condition string for WHERE or Having statement

@param mixed $conditions
@param array $params
@param array $types
@return string
Generate condition string for WHERE or Having statement