category photos should be working

This commit is contained in:
2025-10-12 01:04:36 -07:00
parent 66db31c7ad
commit 30aad1dea4
11 changed files with 105 additions and 9 deletions

View File

@@ -42,5 +42,6 @@ class Product extends Entity
'product_category' => false,
'product_attributes' => true,
'product_category_variants' => true,
'primary_product_photo' => true,
];
}

View File

@@ -53,5 +53,6 @@ class ProductCategory extends Entity
'product_catalog' => true,
'parent_product_category' => true,
'child_product_categories' => true,
'primary_product_photo' => true,
];
}

View File

@@ -3,6 +3,7 @@ declare(strict_types=1);
namespace CakeProducts\Model\Entity;
use Cake\I18n\DateTime;
use Cake\ORM\Entity;
/**
@@ -10,17 +11,21 @@ use Cake\ORM\Entity;
*
* @property string $id
* @property string $product_id
* @property string|null $product_category_id
* @property string|null $product_sku_id
* @property string $photo_dir
* @property string $photo_filename
* @property bool $primary_photo
* @property bool $primary_category_photo
* @property int $photo_position
* @property bool $enabled
* @property \Cake\I18n\DateTime $created
* @property \Cake\I18n\DateTime|null $modified
* @property \Cake\I18n\DateTime|null $deleted
* @property DateTime $created
* @property DateTime|null $modified
* @property DateTime|null $deleted
*
* @property \CakeProducts\Model\Entity\Product $product
* @property Product|null $product
* @property ProductSku|null $product_sku
* @property ProductCategory $product_category
*/
class ProductPhoto extends Entity
{
@@ -36,16 +41,18 @@ class ProductPhoto extends Entity
protected array $_accessible = [
'product_id' => true,
'product_sku_id' => true,
'product_category_id' => true,
'photo_dir' => true,
'photo_filename' => true,
'primary_photo' => true,
'primary_category_photo' => true,
'photo_position' => true,
'enabled' => true,
'created' => true,
'modified' => true,
'deleted' => true,
// entities
'product' => true,
];
}