add soft delete via muffin/trash to all product related tables

This commit is contained in:
bs
2025-04-08 01:30:40 -07:00
parent 013bec1b54
commit cf7c67763c
33 changed files with 188 additions and 11 deletions
+7
View File
@@ -60,9 +60,12 @@ class ProductsTable extends Table
$this->hasMany('ProductAttributes', [
'className' => 'CakeProducts.ProductAttributes',
'dependent' => true,
'cascadeCallbacks' => true,
]);
$this->getSchema()->setColumnType('product_type_id', EnumType::from(ProductProductTypeId::class));
$this->addBehavior('Muffin/Trash.Trash');
}
/**
@@ -88,6 +91,10 @@ class ProductsTable extends Table
->requirePresence('product_type_id', 'create')
->notEmptyString('product_type_id');
$validator
->dateTime('deleted')
->allowEmptyDateTime('deleted');
return $validator;
}