ProductRepository
in package
Repository for product persistence operations.
Designed to be injected via the DI container into commands that need to load or save products.
Table of Contents
- find() : WC_Product|null
- Find a product by ID.
- save() : void
- Save a product.
Methods
find()
Find a product by ID.
public
find(int $id) : WC_Product|null
Parameters
- $id : int
-
The product ID.
Return values
WC_Product|null — The product, or null if not found.save()
Save a product.
public
save(WC_Product $product) : void
Parameters
- $product : WC_Product
-
The product to save.
