Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLTypes\Interfaces
ObjectWithId{}
No Hooks.
Usage
$ObjectWithId = new ObjectWithId(); // use class methods
Methods
- public static get()
ObjectWithId{} ObjectWithId{} code WC 10.9.1
class ObjectWithId {
private static ?InterfaceType $instance = null;
public static function get(): InterfaceType {
if ( null === self::$instance ) {
self::$instance = new InterfaceType(
array(
'name' => 'ObjectWithId',
'description' => __( 'An object with a numeric ID.', 'woocommerce' ),
'fields' => fn() => array(
'id' => array(
'type' => Type::nonNull( Type::int() ),
'description' => __( 'The unique numeric identifier.', 'woocommerce' ),
),
),
'resolveType' => function ( $value ) {
$class = get_class( $value );
$map = array(
'Automattic\WooCommerce\Api\Types\Coupons\Coupon' => CouponType::get(),
);
return $map[ $class ] ?? null;
},
)
);
}
return self::$instance;
}
}