bring into standalone plugin for distribution
This commit is contained in:
23
src/Model/Enum/ProductCategoryAttributeTypeId.php
Normal file
23
src/Model/Enum/ProductCategoryAttributeTypeId.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace CakeProducts\Model\Enum;
|
||||
|
||||
use Cake\Database\Type\EnumLabelInterface;
|
||||
use Tools\Model\Enum\EnumOptionsTrait;
|
||||
|
||||
enum ProductCategoryAttributeTypeId: int implements EnumLabelInterface
|
||||
{
|
||||
use EnumOptionsTrait;
|
||||
|
||||
case Constrained = 1;
|
||||
case Text = 2;
|
||||
case Integer = 3;
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match($this) {
|
||||
self::Constrained => 'Constrained',
|
||||
self::Text => 'Text',
|
||||
self::Integer => 'Integer'
|
||||
};
|
||||
}
|
||||
}
|
||||
23
src/Model/Enum/ProductProductTypeId.php
Normal file
23
src/Model/Enum/ProductProductTypeId.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
namespace CakeProducts\Model\Enum;
|
||||
|
||||
use Cake\Database\Type\EnumLabelInterface;
|
||||
use Tools\Model\Enum\EnumOptionsTrait;
|
||||
|
||||
enum ProductProductTypeId: int implements EnumLabelInterface
|
||||
{
|
||||
use EnumOptionsTrait;
|
||||
|
||||
case Service = 1;
|
||||
case Product = 2;
|
||||
case Consumable = 3;
|
||||
|
||||
public function label(): string
|
||||
{
|
||||
return match($this) {
|
||||
self::Service => 'Service',
|
||||
self::Product => 'Product',
|
||||
self::Consumable => 'Consumable'
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user