Automattic\WooCommerce\Api\Infrastructure

MetadataController::get_auth_entry_typeprivate staticWC 1.0

The AuthEntry output type — one authorization attribute attached to a target. Carries the attribute's short class name and the scalar args supplied at the usage site.

Method of the class: MetadataController{}

No Hooks.

Returns

null. Nothing (null).

Usage

$result = MetadataController::get_auth_entry_type(): ObjectType;

MetadataController::get_auth_entry_type() code WC 10.9.1

private static function get_auth_entry_type(): ObjectType {
	if ( null === self::$auth_entry_type ) {
		self::$auth_entry_type = new ObjectType(
			array(
				'name'        => 'AuthEntry',
				'description' => __( 'One authorization attribute attached to a schema target.', 'woocommerce' ),
				'fields'      => fn() => array(
					'attribute' => array(
						'type'        => Type::nonNull( Type::string() ),
						'description' => __( 'Short class name of the authorization attribute (e.g. `RequiredCapability`).', 'woocommerce' ),
					),
					'args'      => array(
						'type'        => Type::nonNull( Type::listOf( self::get_value_scalar() ) ),
						'description' => __( 'Constructor arguments supplied at the usage site, in source order. Element type is the same scalar union as `MetadataValue`.', 'woocommerce' ),
					),
				),
			)
		);
	}
	return self::$auth_entry_type;
}