protected function formatWhereClause($where)
    {
        if (!empty($where)) {
            if (stripos($where, 'where') === false || stripos($where, 'select') !== false) {
                $where = ' where ' . $where;
            }
        }

        return $where;
    }