remove variant type id (enum) from variants table, use internal id for category field on variants form
This commit is contained in:
@@ -3,13 +3,10 @@ declare(strict_types=1);
|
||||
|
||||
namespace CakeProducts\Model\Table;
|
||||
|
||||
use Cake\Database\Type\EnumType;
|
||||
use Cake\ORM\Query\SelectQuery;
|
||||
use Cake\ORM\RulesChecker;
|
||||
use Cake\ORM\Table;
|
||||
use Cake\Validation\Validator;
|
||||
use CakeProducts\Model\Enum\ProductCategoryAttributeTypeId;
|
||||
use CakeProducts\Model\Enum\ProductCategoryVariantTypeId;
|
||||
|
||||
/**
|
||||
* ProductCategoryVariants Model
|
||||
@@ -56,8 +53,6 @@ class ProductCategoryVariantsTable extends Table
|
||||
'foreignKey' => 'product_id',
|
||||
'className' => 'CakeProducts.Products',
|
||||
]);
|
||||
$this->getSchema()->setColumnType('variant_type_id', EnumType::from(ProductCategoryVariantTypeId::class));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,11 +77,6 @@ class ProductCategoryVariantsTable extends Table
|
||||
->uuid('product_id')
|
||||
->allowEmptyString('product_id');
|
||||
|
||||
$validator
|
||||
->integer('variant_type_id')
|
||||
->requirePresence('variant_type_id', 'create')
|
||||
->notEmptyString('variant_type_id');
|
||||
|
||||
$validator
|
||||
->boolean('enabled')
|
||||
->requirePresence('enabled', 'create')
|
||||
|
||||
Reference in New Issue
Block a user