public static function getQueryString($moduleName, array $params, array $select = [ ], $limit = 0, $offset = 0)
    {
        $criteria = array();
        $select = (empty($select)) ? '*' : implode(',', $select);
        $query = sprintf("SELECT %s FROM $moduleName", $select);
        
        if (!empty($params)) {
            foreach ($params as $param => $value) {
                $criteria[ ] = "{$param} LIKE '{$value}'";
            }

            $query .= sprintf(' WHERE %s', implode(" AND ", $criteria));
        }

        if (intval($limit) > 0) {
            $query .= (intval($offset) > 0)
                ? sprintf(" LIMIT %s, %s", intval($offset), intval($limit))
                : sprintf(" LIMIT %s", intval($limit));
        }

        return $query;
    }