Automattic\WooCommerce\Admin

ReportCSVExporter::map_report_controllerprotectedWC 1.0

Get a REST controller instance for the report type.

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

Хуков нет.

Возвращает

true|false|WC_REST_Reports_Controller. Report controller instance or boolean false on error.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->map_report_controller();

Код ReportCSVExporter::map_report_controller() WC 11.0.1

protected function map_report_controller() {
	$controller_map = self::get_report_controller_map();

	if ( isset( $controller_map[ $this->report_type ] ) ) {
		// Load the controllers if accessing outside the REST API.
		return new $controller_map[ $this->report_type ]();
	}

	// Should this do something else?
	return false;
}