Automattic\WooCommerce\Internal\Admin\Settings

SettingsUIRequestContext::resolve_schemaprivateWC 1.0

Resolve the Settings UI schema.

Method of the class: SettingsUIRequestContext{}

No Hooks.

Returns

null. Nothing (null).

Usage

// private - for code of main (parent) class only
$result = $this->resolve_schema(): void;

SettingsUIRequestContext::resolve_schema() code WC 10.9.1

private function resolve_schema(): void {
	$this->schema_resolved = true;
	$this->schema          = null;

	if ( ! $this->settings_ui_page ) {
		return;
	}

	try {
		$this->schema = $this->settings_ui_page->get_schema( $this->section );
	} catch ( \Throwable $e ) {
		$this->schema_failed = true;

		wc_get_logger()->debug(
			sprintf(
				'Settings UI schema could not be resolved for page "%1$s" section "%2$s": %3$s: %4$s',
				$this->get_page_id(),
				'' === $this->section ? self::DEFAULT_SECTION_KEY : $this->section,
				get_class( $e ),
				$e->getMessage()
			),
			array( 'source' => 'settings-ui' )
		);

		if ( $e instanceof \Exception ) {
			wc_caught_exception( $e, __CLASS__ . '::' . __FUNCTION__ );
		}
	}
}