Added seoTitle and seoDescription fields to the Product model and updated relevant components to utilize these fields for improved SEO.
58 lines
1.8 KiB
PHP
58 lines
1.8 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Domain\Models\Entities;
|
|
|
|
use Domain\Models\ValueObjects\Entities\ProductId;
|
|
use Domain\Models\ValueObjects\Products\NutritionalValues;
|
|
use Domain\Models\ValueObjects\Products\ProductCategory;
|
|
use Domain\Models\ValueObjects\Products\Technology;
|
|
use Shared\DDD\Entity;
|
|
|
|
/**
|
|
* @implements Entity<ProductId>
|
|
*/
|
|
readonly class Product implements Entity
|
|
{
|
|
public function __construct(
|
|
public ProductId $id,
|
|
public string $name,
|
|
public string $slug,
|
|
public ProductCategory $category,
|
|
public Technology $technology,
|
|
public bool $isEgalim,
|
|
/** @var \Domain\Models\ValueObjects\Products\BreedingMethod[] */
|
|
public array $breedingMethods,
|
|
/** @var \Domain\Models\ValueObjects\Products\Business[] */
|
|
public array $businesses,
|
|
public string $detailsAndAdvantages,
|
|
/** @var \Domain\Models\ValueObjects\Products\ProductFormat[] */
|
|
public array $formats,
|
|
public string $handlingAdvices,
|
|
public ?string $ingredients,
|
|
public string $conservationBeforeOpening,
|
|
public string $description,
|
|
public ?string $seoTitle = null,
|
|
public ?string $seoDescription = null,
|
|
public ?string $conservationAfterOpening = null,
|
|
public ?NutritionalValues $nutritionalValues = null,
|
|
public ?string $picture = null,
|
|
public ?string $pictureAlt = null,
|
|
public ?string $pictureTitle = null,
|
|
public ?string $pdfFilePath = null,
|
|
/** @var \Ramsey\Uuid\UuidInterface[] */
|
|
public array $associatedRecipes = [],
|
|
) {
|
|
}
|
|
|
|
public function id(): ProductId
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
public function __toString(): string
|
|
{
|
|
return $this->slug;
|
|
}
|
|
}
|