add the contain for product skus on products
This commit is contained in:
parent
4356dcd800
commit
9d9c32f0b9
|
@ -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));
|
||||
|
||||
|
|
|
@ -65,6 +65,7 @@ class ProductsTableTest extends TestCase
|
|||
'ProductCategories',
|
||||
'ProductAttributes',
|
||||
'ProductCategoryVariants',
|
||||
'ProductSkus',
|
||||
];
|
||||
$associations = $this->Products->associations();
|
||||
|
||||
|
|
Loading…
Reference in New Issue