CakeProducts/src/Model/Entity/Product.php

47 lines
1.2 KiB
PHP
Raw Normal View History

<?php
declare(strict_types=1);
namespace CakeProducts\Model\Entity;
use Cake\I18n\DateTime;
use Cake\ORM\Entity;
use CakeProducts\Model\Enum\ProductProductTypeId;
/**
* Product Entity
*
* @property string $id
* @property string $name
* @property string $product_category_id
* @property ProductProductTypeId $product_type_id
* @property DateTime|null $deleted
*
* @property ProductCategory $product_category
* @property ProductAttribute[] $product_attributes
* @property ProductCategoryVariant[] $product_category_variants
*
*/
class Product 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_id' => true,
'product_type_id' => true,
'deleted' => true,
// entities
'product_category' => false,
2025-04-05 09:06:23 +00:00
'product_attributes' => true,
'product_category_variants' => false,
];
}