private function fixDuplicateArgs($origArgs, $result) {
        $duplicates = array_intersect_key($result['args'], $origArgs); // Holds all keys in results already in the args
        if (count($duplicates) === 0) return $result;

        foreach ($duplicates as $argKey => $argVal) {
            $valHash = substr(md5($argVal), 0, 5);
            $newKey = $argKey . $valHash;

            // Replace occurences of duplicate key with key + hash as arg
            $result['sql'] = str_replace(':' . $argKey, ':' . $newKey, $result['sql']);
            unset($result['args'][$argKey]);
            $result['args'][$newKey] = $argVal;
        }

        return $result;
    }
private function fixDuplicateArgs($origArgs, $result) {
        $duplicates = array_intersect_key($result['args'], $origArgs); // Holds all keys in results already in the args
        if (count($duplicates) === 0) return $result;

        foreach ($duplicates as $argKey => $argVal) {
            $valHash = substr(md5($argVal), 0, 5);
            $newKey = $argKey . $valHash;

            // Replace occurences of duplicate key with key + hash as arg
            $result['sql'] = str_replace(':' . $argKey, ':' . $newKey, $result['sql']);
            unset($result['args'][$argKey]);
            $result['args'][$newKey] = $argVal;
        }

        return $result;
    }
private function fixDuplicateArgs ( $ origArgs , $ result ) { $ duplicates = array_intersect_key ( $ result [ 'args' ] , $ origArgs ) ; // Holds all keys in results already in the args if ( count ( $ duplicates ) === 0 ) return $ result ; foreach ( $ duplicates as $ argKey => $ argVal ) { $ valHash = substr ( md5 ( $ argVal ) , 0 , 5 ) ; $ newKey = $ argKey . $ valHash ; // Replace occurences of duplicate key with key + hash as arg $ result [ 'sql' ] = str_replace ( ':' . $ argKey , ':' . $ newKey , $ result [ 'sql' ] ) ; unset ( $ result [ 'args' ] [ $ argKey ] ) ; $ result [ 'args' ] [ $ newKey ] = $ argVal ; } return $ result ; }
Returns result with duplicate issues removed
Returns result with duplicate issues removed