Automattic\WooCommerce\Admin\API\Reports

SqlQuery::str_replace_clause()protectedWC 1.0

Replace strings within SQL clauses by type.

Method of the class: SqlQuery{}

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->str_replace_clause( $type, $search, $replace );
$type(string) (required)
Clause type.
$search(string) (required)
String to search for.
$replace(string) (required)
Replacement string.

SqlQuery::str_replace_clause() code WC 7.3.0

protected function str_replace_clause( $type, $search, $replace ) {
	if ( isset( $this->sql_clauses[ $type ] ) ) {
		foreach ( $this->sql_clauses[ $type ] as $key => $sql ) {
			$this->sql_clauses[ $type ][ $key ] = str_replace( $search, $replace, $sql );
		}
	}
}