Automattic\WooCommerce\Internal\Api\Autogenerated\GraphQLTypes\Input
UpdateProduct{}
No Hooks.
Usage
$UpdateProduct = new UpdateProduct(); // use class methods
Methods
- public string()
- public static get()
- ERROR: no method name found on line `),`
- ERROR: no method name found on line `}`
- ERROR: no method name found on line ``
- ERROR: no method name found on line `),`
UpdateProduct{} UpdateProduct{} code WC 10.9.1
class UpdateProduct {
private static ?InputObjectType $instance = null;
public static function get(): InputObjectType {
if ( null === self::$instance ) {
self::$instance = new InputObjectType(
array(
'name' => 'UpdateProductInput',
'description' => __( 'Data for updating an existing product.', 'woocommerce' ),
'fields' => fn() => array(
'id' => array(
'type' => Type::nonNull( Type::int() ),
'description' => __( 'The ID of the product to update.', 'woocommerce' ),
),
'name' => array(
'type' => Type::string(),
'description' => __( 'The product name.', 'woocommerce' ),
),
'slug' => array(
'type' => Type::string(),
'description' => __( 'The product slug.', 'woocommerce' ),
),
'sku' => array(
'type' => Type::string(),
'description' => __( 'The product SKU.', 'woocommerce' ),
),
'description' => array(
'type' => Type::string(),
'description' => __( 'The full product description.', 'woocommerce' ),
),
'short_description' => array(
'type' => Type::string(),
'description' => __( 'The short product description.', 'woocommerce' ),
),
'status' => array(
'type' => ProductStatusType::get(),
'description' => __( 'The product status.', 'woocommerce' ),
),
'product_type' => array(
'type' => ProductTypeType::get(),
'description' => __( 'The product type.', 'woocommerce' ),
),
'regular_price' => array(
'type' => Type::float(),
'description' => __( 'The regular price.', 'woocommerce' ),
),
'sale_price' => array(
'type' => Type::float(),
'description' => __( 'The sale price.', 'woocommerce' ),
),
'manage_stock' => array(
'type' => Type::boolean(),
'description' => __( 'Whether to manage stock.', 'woocommerce' ),
),
'stock_quantity' => array(
'type' => Type::int(),
'description' => __( 'The number of items in stock.', 'woocommerce' ),
),
'dimensions' => array(
'type' => DimensionsInput::get(),
'description' => __( 'The product dimensions.', 'woocommerce' ),
),
),
)
);
}
return self::$instance;
}
}