src/Entity/ProductTranslation.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProductTranslationRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation\Slug;
  7. use Gedmo\Mapping\Annotation\SlugHandler;
  8. use Gedmo\Sluggable\Handler\RelativeSlugHandler;
  9. use Knp\DoctrineBehaviors\Contract\Entity\TranslationInterface;
  10. use Knp\DoctrineBehaviors\Model\Translatable\TranslationTrait;
  11. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  12. use Symfony\Component\Validator\Constraints as Assert;
  13. #[ORM\Entity(repositoryClassProductTranslationRepository::class)]
  14. class ProductTranslation implements TranslationInterface
  15. {
  16.     use TranslationTrait;
  17.     #[ORM\Id]
  18.     #[ORM\GeneratedValue(strategy"IDENTITY")]
  19.     #[ORM\Column]
  20.     private ?int $id null;
  21.     #[ORM\Column(length150nullabletrue)]
  22.     #[Assert\NotBlank]
  23.     private ?string $name null;
  24.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  25.     private ?string $additionalInfo null;
  26.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  27.     private ?string $productFeatures null;
  28.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  29.     private ?string $howItWorks null;
  30.     #[ORM\Column(length50nullabletrue)]
  31.     #[Assert\Length(max50)]
  32.     private ?string $cartUnitsMessage null;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     #[Assert\Length(max255)]
  35.     private ?string $sharedPackageFormat null;
  36.     public function getName(): ?string
  37.     {
  38.         return $this->name;
  39.     }
  40.     public function setName(?string $name): self
  41.     {
  42.         $this->name $name;
  43.         return $this;
  44.     }
  45.     public function getAdditionalInfo(): ?string
  46.     {
  47.         return $this->additionalInfo;
  48.     }
  49.     public function setAdditionalInfo(?string $additionalInfo): self
  50.     {
  51.         $this->additionalInfo $additionalInfo;
  52.         return $this;
  53.     }
  54.     public function getProductFeatures(): ?string
  55.     {
  56.         return $this->productFeatures;
  57.     }
  58.     public function setProductFeatures(?string $productFeatures): self
  59.     {
  60.         $this->productFeatures $productFeatures;
  61.         return $this;
  62.     }
  63.     public function getHowItWorks(): ?string
  64.     {
  65.         return $this->howItWorks;
  66.     }
  67.     public function setHowItWorks(?string $howItWorks): self
  68.     {
  69.         $this->howItWorks $howItWorks;
  70.         return $this;
  71.     }
  72.     public function getCartUnitsMessage(): ?string
  73.     {
  74.         return $this->cartUnitsMessage ?? $this->sharedPackageFormat ?? '';
  75.     }
  76.     public function setCartUnitsMessage(?string $cartUnitsMessage): self
  77.     {
  78.         $this->cartUnitsMessage $cartUnitsMessage;
  79.         return $this;
  80.     }
  81.     public function getSharedPackageFormat(): ?string
  82.     {
  83.         return $this->sharedPackageFormat;
  84.     }
  85.     public function setSharedPackageFormat(?string $sharedPackageFormat): self
  86.     {
  87.         $this->sharedPackageFormat $sharedPackageFormat;
  88.         return $this;
  89.     }
  90. }