private function buildQuery($pattern, $args)
    {

        if (count($args['parameters']) > 0) {

            $string = $pattern[0];
        } else {

            $string = $pattern[1];
        }

        if (preg_match_all("/:(\w+)/", $string, $match)) {

            $match = $match[0];
            $values = array_values($args);
            return str_replace($match, $values, $string);
        }
    }
private function buildQuery($pattern, $args)
    {

        if (count($args['parameters']) > 0) {

            $string = $pattern[0];
        } else {

            $string = $pattern[1];
        }

        if (preg_match_all("/:(\w+)/", $string, $match)) {

            $match = $match[0];
            $values = array_values($args);
            return str_replace($match, $values, $string);
        }
    }
private function buildQuery ( $ pattern , $ args ) { if ( count ( $ args [ 'parameters' ] ) > 0 ) { $ string = $ pattern [ 0 ] ; } else { $ string = $ pattern [ 1 ] ; } if ( preg_match_all ( "/:(\w+)/" , $ string , $ match ) ) { $ match = $ match [ 0 ] ; $ values = array_values ( $ args ) ; return str_replace ( $ match , $ values , $ string ) ; } }
create the a sql query

@param array $pattern
@param array $args
@return mixed
create the a sql query