product variants table split off from category variants table, variant values table updated to reflect

This commit is contained in:
2025-10-03 02:16:24 -07:00
parent d49a8784e6
commit 49912abd3a
21 changed files with 477 additions and 46 deletions

View File

@@ -10,7 +10,7 @@ use Cake\ORM\Entity;
*
* @property string $id
* @property string $product_sku_id
* @property string $product_category_variant_id
* @property string $product_variant_id
* @property string $product_category_variant_option_id
*
* @property ProductSku $product_sku
@@ -30,12 +30,12 @@ class ProductSkuVariantValue extends Entity
*/
protected array $_accessible = [
'product_sku_id' => true,
'product_category_variant_id' => true,
'product_variant_id' => true,
'product_category_variant_option_id' => true,
// entities
'product_skus' => true,
'product_category_variant' => true,
'product_variant' => true,
'product_category_variant_option' => true,
];
}

View File

@@ -0,0 +1,39 @@
<?php
declare(strict_types=1);
namespace CakeProducts\Model\Entity;
use Cake\ORM\Entity;
/**
* ProductVariant Entity
*
* @property string $id
* @property string $name
* @property string|null $product_category_variant_id
* @property string $product_id
* @property bool $enabled
*
* @property \App\Model\Entity\ProductCategoryVariant $product_category_variant
* @property \App\Model\Entity\Product $product
*/
class ProductVariant extends Entity
{
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* Note that when '*' is set to true, this allows all unspecified fields to
* be mass assigned. For security purposes, it is advised to set '*' to false
* (or remove it), and explicitly make individual fields accessible as needed.
*
* @var array<string, bool>
*/
protected array $_accessible = [
'name' => true,
'product_category_variant_id' => true,
'product_id' => true,
'enabled' => true,
'product_category_variant' => true,
'product' => true,
];
}