public static function createConditionals(array $tokens) {
        if(!isset($tokens['WHERE'])) return '';

        $tableAlias = Table::alias($tokens);
        $primaryKeyColumn = sprintf('%s.%s', $tableAlias, Identifier::column($tokens, new MetaData));

        // Get WHERE conditions as string including table alias and primary key column if present
        $sqlWhereString = array_reduce($tokens['WHERE'], function($query, $token) use ($tableAlias) {
            return $query . str_replace(['"', '\''], '', str_replace('OR', '|', str_replace('AND', '&', $token['base_expr'])));
        });

        // Remove primary key column before removing table alias and returning
        return str_replace($tableAlias . '.', '', preg_replace('/' . preg_quote($primaryKeyColumn) . '=[\w\d]*&*/', '', $sqlWhereString));
    }
public static function createConditionals(array $tokens) {
        if(!isset($tokens['WHERE'])) return '';

        $tableAlias = Table::alias($tokens);
        $primaryKeyColumn = sprintf('%s.%s', $tableAlias, Identifier::column($tokens, new MetaData));

        // Get WHERE conditions as string including table alias and primary key column if present
        $sqlWhereString = array_reduce($tokens['WHERE'], function($query, $token) use ($tableAlias) {
            return $query . str_replace(['"', '\''], '', str_replace('OR', '|', str_replace('AND', '&', $token['base_expr'])));
        });

        // Remove primary key column before removing table alias and returning
        return str_replace($tableAlias . '.', '', preg_replace('/' . preg_quote($primaryKeyColumn) . '=[\w\d]*&*/', '', $sqlWhereString));
    }
public static function createConditionals ( array $ tokens ) { if ( ! isset ( $ tokens [ 'WHERE' ] ) ) return '' ; $ tableAlias = Table :: alias ( $ tokens ) ; $ primaryKeyColumn = sprintf ( '%s.%s' , $ tableAlias , Identifier :: column ( $ tokens , new MetaData ) ) ; // Get WHERE conditions as string including table alias and primary key column if present $ sqlWhereString = array_reduce ( $ tokens [ 'WHERE' ] , function ( $ query , $ token ) use ( $ tableAlias ) { return $ query . str_replace ( [ '"' , '\'' ] , '' , str_replace ( 'OR' , '|' , str_replace ( 'AND' , '&' , $ token [ 'base_expr' ] ) ) ) ; } ) ; // Remove primary key column before removing table alias and returning return str_replace ( $ tableAlias . '.' , '' , preg_replace ( '/' . preg_quote ( $ primaryKeyColumn ) . '=[\w\d]*&*/' , '' , $ sqlWhereString ) ) ; }
Create a string of conditional parameters.

@param array $tokens
@return string

@SuppressWarnings("PHPMD.StaticAccess")
Create a string of conditional parameters .