src/SQL/Criteria.php
public static function buildCriteria(array $values, $qmMode = false)
    {
        reset($values);
        $qmMode = $qmMode ?: is_numeric(key($values));

        if ($qmMode) {
            $result = array_values($values);
            array_unshift($result, str_repeat('?,', count($values)-1).'?');

            return $result;
        }

        $result = [''];
        foreach ($values as $key => $value) {
            $key = ":$key";
            $result[0] .= ($result[0]?',':'').$key;
            $result[$key] = $value;
        }

        return $result;
    }
public static function buildCriteria(array $values, $qmMode = false)
    {
        reset($values);
        $qmMode = $qmMode ?: is_numeric(key($values));

        if ($qmMode) {
            $result = array_values($values);
            array_unshift($result, str_repeat('?,', count($values)-1).'?');

            return $result;
        }

        $result = [''];
        foreach ($values as $key => $value) {
            $key = ":$key";
            $result[0] .= ($result[0]?',':'').$key;
            $result[$key] = $value;
        }

        return $result;
    }
public static function buildCriteria ( array $ values , $ qmMode = false ) { reset ( $ values ) ; $ qmMode = $ qmMode ? : is_numeric ( key ( $ values ) ) ; if ( $ qmMode ) { $ result = array_values ( $ values ) ; array_unshift ( $ result , str_repeat ( '?,' , count ( $ values ) - 1 ) . '?' ) ; return $ result ; } $ result = [ '' ] ; foreach ( $ values as $ key => $ value ) { $ key = ":$key" ; $ result [ 0 ] .= ( $ result [ 0 ] ? ',' : '' ) . $ key ; $ result [ $ key ] = $ value ; } return $ result ; }
Array to mapper criteria
@param  array   $values
@param  boolean $qmMode force question mark placeholder
@return string
Array to mapper criteria