CatalogVisibility.php
4 weeks ago
DefaultCustomerAddress.php
2 months ago
FeaturePluginCompatibility.php
4 weeks ago
OrderInternalStatus.php
4 weeks ago
OrderItemType.php
2 months ago
OrderStatus.php
4 weeks ago
PaymentGatewayFeature.php
7 months ago
ProductStatus.php
4 weeks ago
ProductStockStatus.php
4 weeks ago
ProductTaxStatus.php
1 year ago
ProductType.php
4 weeks ago
TaxBasedOn.php
2 months ago
ProductStockStatus.php
55 lines
| 1 | <?php |
| 2 | |
| 3 | declare( strict_types = 1 ); |
| 4 | |
| 5 | namespace Automattic\WooCommerce\Enums; |
| 6 | |
| 7 | /** |
| 8 | * Enum class for all the product stock statuses. |
| 9 | */ |
| 10 | final class ProductStockStatus { |
| 11 | /** |
| 12 | * The product is in stock. |
| 13 | * |
| 14 | * @var string |
| 15 | */ |
| 16 | public const IN_STOCK = 'instock'; |
| 17 | |
| 18 | /** |
| 19 | * The product is out of stock. |
| 20 | * |
| 21 | * @var string |
| 22 | */ |
| 23 | public const OUT_OF_STOCK = 'outofstock'; |
| 24 | |
| 25 | /** |
| 26 | * The product is on backorder. |
| 27 | * |
| 28 | * @var string |
| 29 | */ |
| 30 | public const ON_BACKORDER = 'onbackorder'; |
| 31 | |
| 32 | /** |
| 33 | * The product is low in stock. |
| 34 | * |
| 35 | * @var string |
| 36 | */ |
| 37 | public const LOW_STOCK = 'lowstock'; |
| 38 | |
| 39 | /** |
| 40 | * Returns all product stock status values. |
| 41 | * |
| 42 | * @since 10.9.0 |
| 43 | * |
| 44 | * @return string[] |
| 45 | */ |
| 46 | public static function get_all(): array { |
| 47 | return array( |
| 48 | self::IN_STOCK, |
| 49 | self::OUT_OF_STOCK, |
| 50 | self::ON_BACKORDER, |
| 51 | self::LOW_STOCK, |
| 52 | ); |
| 53 | } |
| 54 | } |
| 55 |