| 1 |
<?php |
| 2 |
|
| 3 |
namespace Give\DonationForms\V2\ValueObjects; |
| 4 |
|
| 5 |
use Give\Framework\Support\ValueObjects\Enum; |
| 6 |
|
| 7 |
/** |
| 8 |
* @since 2.24.0 |
| 9 |
* |
| 10 |
* @method static DonationFormStatus PENDING() |
| 11 |
* @method static DonationFormStatus PUBLISHED() |
| 12 |
* @method static DonationFormStatus PRIVATE () |
| 13 |
* @method static DonationFormStatus DRAFT() |
| 14 |
* @method static DonationFormStatus TRASH() |
| 15 |
* @method static DonationFormStatus UPGRADED() |
| 16 |
* @method bool isPending() |
| 17 |
* @method bool isPublished() |
| 18 |
* @method bool isPrivate() |
| 19 |
* @method bool isDraft() |
| 20 |
* @method bool isTrash() |
| 21 |
* @method bool isUpgraded() |
| 22 |
*/ |
| 23 |
class DonationFormStatus extends Enum |
| 24 |
{ |
| 25 |
const PENDING = 'pending'; |
| 26 |
const PUBLISHED = 'publish'; |
| 27 |
const PRIVATE = 'private'; |
| 28 |
const DRAFT = 'draft'; |
| 29 |
const TRASH = 'trash'; |
| 30 |
const UPGRADED = 'upgraded'; |
| 31 |
|
| 32 |
/** |
| 33 |
* @since 2.24.0 |
| 34 |
* |
| 35 |
* @return array |
| 36 |
*/ |
| 37 |
public static function labels(): array |
| 38 |
{ |
| 39 |
return [ |
| 40 |
self::PENDING => __( 'Pending', 'give' ), |
| 41 |
self::PUBLISHED => __( 'Published', 'give' ), |
| 42 |
self::PRIVATE => __( 'Private', 'give' ), |
| 43 |
self::DRAFT => __( 'Draft', 'give' ), |
| 44 |
self::TRASH => __( 'Trash', 'give' ), |
| 45 |
self::UPGRADED => __( 'Upgraded', 'give' ), |
| 46 |
]; |
| 47 |
} |
| 48 |
|
| 49 |
/** |
| 50 |
* @since 2.24.0 |
| 51 |
* |
| 52 |
* @return string |
| 53 |
*/ |
| 54 |
public function label(): string |
| 55 |
{ |
| 56 |
return self::labels()[ $this->getValue() ]; |
| 57 |
} |
| 58 |
} |
| 59 |
|