primary sku photo working with janky toggle workaround but w/e lol
This commit is contained in:
@@ -58,6 +58,7 @@ class ProductPhotosTable extends Table
|
||||
);
|
||||
|
||||
$this->addBehavior('Timestamp');
|
||||
|
||||
$this->addBehavior('Tools.Toggle', [
|
||||
'field' => 'primary_photo',
|
||||
'scopeFields' => ['product_id'],
|
||||
@@ -74,6 +75,14 @@ class ProductPhotosTable extends Table
|
||||
'product_category_id IS NOT' => null,
|
||||
],
|
||||
]);
|
||||
$this->addBehavior('CakeProducts.ThirdToggle', [
|
||||
'field' => 'primary_sku_photo',
|
||||
'scopeFields' => ['product_sku_id'],
|
||||
'scope' => [
|
||||
'deleted IS' => null,
|
||||
'product_sku_id IS NOT' => null,
|
||||
],
|
||||
]);
|
||||
$this->belongsTo('Products', [
|
||||
'foreignKey' => 'product_id',
|
||||
'joinType' => 'LEFT',
|
||||
|
||||
Reference in New Issue
Block a user