Automattic\WooCommerce\Api\Utils

SchemaHandle::read_type_authorizationprivate staticWC 1.0

Read authorization descriptors attached to a wrapped engine type.

The wrapper subclasses preserve the original config in $type->config; authorization descriptors emitted by ApiBuilder live under the authorization key as a list of {attribute, args} records.

Method of the class: SchemaHandle{}

No Hooks.

Returns

list. string, args: list<mixed>}>

Usage

$result = SchemaHandle::read_type_authorization( $type ): array;
$type(Type) (required)
The GraphQL type to inspect.

SchemaHandle::read_type_authorization() code WC 10.9.1

private static function read_type_authorization( Type $type ): array {
	if ( ! property_exists( $type, 'config' ) ) {
		return array();
	}
	$authorization = $type->config['authorization'] ?? array();
	return is_array( $authorization ) ? $authorization : array();
}