variant options wip

This commit is contained in:
2025-07-05 20:08:56 -07:00
parent c9d34f7115
commit 5adc791c20
16 changed files with 462 additions and 1 deletions

View File

@@ -17,6 +17,7 @@ use Cake\ORM\Entity;
*
* @property ProductCategory|EntityInterface $product_category
* @property Product|EntityInterface $product
* @property ProductCategoryVariantOption[]|EntityInterface[] $product_category_variant_options
*/
class ProductCategoryVariant extends Entity
{
@@ -34,8 +35,10 @@ class ProductCategoryVariant extends Entity
'product_category_id' => true,
'product_id' => true,
'enabled' => true,
// entities
'product_category' => false,
'product' => false,
'product_category_variant_options' => true,
];
}

View File

@@ -0,0 +1,40 @@
<?php
declare(strict_types=1);
namespace CakeProducts\Model\Entity;
use Cake\ORM\Entity;
/**
* ProductCategoryVariantOption Entity
*
* @property string $id
* @property string $product_category_variant_id
* @property string $variant_value
* @property \Cake\I18n\DateTime $created
* @property \Cake\I18n\DateTime $modified
* @property \Cake\I18n\DateTime|null $deleted
*
* @property \App\Model\Entity\ProductCategoryVariant $product_category_variant
*/
class ProductCategoryVariantOption 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 = [
'product_category_variant_id' => true,
'variant_value' => true,
'created' => true,
'modified' => true,
'deleted' => true,
// entities
'product_category_variant' => false,
];
}