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
ProductStatus.php
79 lines
| 1 | <?php |
| 2 | |
| 3 | declare( strict_types = 1 ); |
| 4 | |
| 5 | namespace Automattic\WooCommerce\Enums; |
| 6 | |
| 7 | /** |
| 8 | * Enum class for all the product statuses. |
| 9 | */ |
| 10 | final class ProductStatus { |
| 11 | /** |
| 12 | * The product is in auto-draft status. |
| 13 | * |
| 14 | * @var string |
| 15 | */ |
| 16 | public const AUTO_DRAFT = 'auto-draft'; |
| 17 | |
| 18 | /** |
| 19 | * The product is in draft status. |
| 20 | * |
| 21 | * @var string |
| 22 | */ |
| 23 | public const DRAFT = 'draft'; |
| 24 | |
| 25 | /** |
| 26 | * The product is in pending status. |
| 27 | * |
| 28 | * @var string |
| 29 | */ |
| 30 | public const PENDING = 'pending'; |
| 31 | |
| 32 | /** |
| 33 | * The product is in private status. |
| 34 | * |
| 35 | * @var string |
| 36 | */ |
| 37 | public const PRIVATE = 'private'; |
| 38 | |
| 39 | /** |
| 40 | * The product is in publish status. |
| 41 | * |
| 42 | * @var string |
| 43 | */ |
| 44 | public const PUBLISH = 'publish'; |
| 45 | |
| 46 | /** |
| 47 | * The product is in trash status. |
| 48 | * |
| 49 | * @var string |
| 50 | */ |
| 51 | public const TRASH = 'trash'; |
| 52 | |
| 53 | /** |
| 54 | * The product is in future status. |
| 55 | * |
| 56 | * @var string |
| 57 | */ |
| 58 | public const FUTURE = 'future'; |
| 59 | |
| 60 | /** |
| 61 | * Returns all product status values. |
| 62 | * |
| 63 | * @since 10.9.0 |
| 64 | * |
| 65 | * @return string[] |
| 66 | */ |
| 67 | public static function get_all(): array { |
| 68 | return array( |
| 69 | self::AUTO_DRAFT, |
| 70 | self::DRAFT, |
| 71 | self::PENDING, |
| 72 | self::PRIVATE, |
| 73 | self::PUBLISH, |
| 74 | self::TRASH, |
| 75 | self::FUTURE, |
| 76 | ); |
| 77 | } |
| 78 | } |
| 79 |