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