Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLTypes\Output

ProductImage{}WC 1.0

No Hooks.

Usage

$ProductImage = new ProductImage();
// use class methods

Methods

  1. public static get()
  2. public array(
  3. ERROR: no method name found on line ``
  4. ERROR: no method name found on line `),`
  5. ERROR: no method name found on line ``
  6. ERROR: no method name found on line ``
  7. ERROR: no method name found on line ``
  8. ERROR: no method name found on line ``
  9. ERROR: no method name found on line ``

ProductImage{} code WC 10.8.1

class ProductImage {
	private static ?ObjectType $instance = null;

	public static function get(): ObjectType {
		if ( null === self::$instance ) {
			self::$instance = new ObjectType(
				array(
					'name'        => 'ProductImage',
					'description' => __( 'Represents a product image.', 'woocommerce' ),
					'fields'      => fn() => array(
						'id'       => array(
							'type'        => Type::nonNull( Type::int() ),
							'description' => __( 'The image attachment ID.', 'woocommerce' ),
						),
						'url'      => array(
							'type'        => Type::nonNull( Type::string() ),
							'description' => __( 'The image URL.', 'woocommerce' ),
						),
						'alt'      => array(
							'type'        => Type::nonNull( Type::string() ),
							'description' => __( 'The image alt text.', 'woocommerce' ),
						),
						'position' => array(
							'type'        => Type::nonNull( Type::int() ),
							'description' => __( 'The image display position.', 'woocommerce' ),
						),
					),
				)
			);
		}
		return self::$instance;
	}
}