add the contain for product skus on products

This commit is contained in:
2025-09-04 22:49:23 -07:00
parent 4356dcd800
commit 9d9c32f0b9
2 changed files with 7 additions and 6 deletions

View File

@@ -76,12 +76,12 @@ class ProductsTable extends Table
'cascadeCallbacks' => true,
]);
// $this->hasMany('ProductSkus', [
// 'foreignKey' => 'product_id',
// 'className' => 'CakeProducts.ProductSkus',
// 'dependent' => true,
// 'cascadeCallbacks' => true,
// ]);
$this->hasMany('ProductSkus', [
'foreignKey' => 'product_id',
'className' => 'CakeProducts.ProductSkus',
'dependent' => true,
'cascadeCallbacks' => true,
]);
$this->getSchema()->setColumnType('product_type_id', EnumType::from(ProductProductTypeId::class));

View File

@@ -65,6 +65,7 @@ class ProductsTableTest extends TestCase
'ProductCategories',
'ProductAttributes',
'ProductCategoryVariants',
'ProductSkus',
];
$associations = $this->Products->associations();