Automattic\WooCommerce\Blueprint\Importers

ImportRunSql::is_allowed_query_type │ private │ WC 1.0

Check if the SQL query type is allowed.

Метод класса: ImportRunSql{}

Хуков нет.

Возвращает

bool. True if the query type is allowed, false otherwise.

Использование

// private - только в коде основоного (родительского) класса
$result = $this->is_allowed_query_type( $sql_content ): bool;
$sql_content(строка) (обязательный)
The SQL query to check.

Код ImportRunSql::is_allowed_query_type() WC 11.2.2

private function is_allowed_query_type( string $sql_content ): bool {
	$uppercase_sql_content = strtoupper( trim( $sql_content ) );

	foreach ( self::ALLOWED_QUERY_TYPES as $query_type ) {
		if ( 0 === stripos( $uppercase_sql_content, $query_type ) ) {
			return true;
		}
	}
	return false;
}