product attributes
This commit is contained in:
@@ -58,6 +58,9 @@ class ProductsTable extends Table
|
||||
'className' => 'CakeProducts.ProductCategories',
|
||||
]);
|
||||
|
||||
$this->hasMany('ProductAttributes', [
|
||||
'className' => 'CakeProducts.ProductAttributes',
|
||||
]);
|
||||
$this->getSchema()->setColumnType('product_type_id', EnumType::from(ProductProductTypeId::class));
|
||||
|
||||
}
|
||||
@@ -99,6 +102,7 @@ class ProductsTable extends Table
|
||||
{
|
||||
$rules->add($rules->isUnique(['product_category_id', 'name']), ['errorField' => 'product_category_id']);
|
||||
$rules->add($rules->existsIn(['product_category_id'], 'ProductCategories'), ['errorField' => 'product_category_id']);
|
||||
// $rules->add($rules->validCount('product_attributes', 0, '<=', 'You must not have any tags'));
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user