Automattic\WooCommerce\RestApi

Server::get_v4_controller │ protected │ WC 1.0

Get instance of a V4 controller.

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

Хуков нет.

Возвращает

object. The instance of the controller.

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->get_v4_controller( $identifier, $route );
$identifier(строка) (обязательный)
Controller identifier.
$route(строка) (обязательный)
Route class name.

Код Server::get_v4_controller() WC 11.2.2

protected function get_v4_controller( $identifier, $route ) {
	if ( isset( $this->controllers['wc/v4'][ $identifier ] ) ) {
		return $this->controllers['wc/v4'][ $identifier ];
	}
	return new $route();
}