Automattic\WooCommerce\StoreApi

SchemaController::get()publicWC 1.0

Get a schema class instance.

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

Хуков нет.

Возвращает

Schemas\V1\AbstractSchema. A new instance of the requested schema.

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

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

Код SchemaController::get() WC 8.7.0

public function get( $name, $version = 1 ) {
	$schema = $this->schemas[ "v{$version}" ][ $name ] ?? false;

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

	return new $schema( $this->extend, $this );
}