Automattic\WooCommerce\StoreApi
SchemaController::get
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() SchemaController::get WC 10.8.1
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 );
}