Automattic\WooCommerce\StoreApi

RoutesController::get()publicWC 1.0

Get a route class instance.

Each route class is instantized with the SchemaController instance, and its main Schema Type.

{} Это метод класса: RoutesController{}

Хуков нет.

Возвращает

AbstractRoute.

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

$RoutesController = new RoutesController();
$RoutesController->get( $name, $version );
$name(строка) (обязательный)
Name of schema.
$version(строка)
API Version being requested.
По умолчанию: 'v1'

Код RoutesController::get() WC 6.9.1

public function get( $name, $version = 'v1' ) {
	$route = $this->routes[ $version ][ $name ] ?? false;

	if ( ! $route ) {
		throw new \Exception( "${name} {$version} route does not exist" );
	}

	return new $route(
		$this->schema_controller,
		$this->schema_controller->get( $route::SCHEMA_TYPE, $route::SCHEMA_VERSION )
	);
}