src/Entity/LocationTranslation.php line 14

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Doctrine\ORM\Mapping\UniqueConstraint;
  6. /**
  7.  * @ORM\Entity()
  8.  * @ORM\Table(uniqueConstraints={@UniqueConstraint(columns={"location_id", "locale"})})
  9.  */
  10. class LocationTranslation implements LocationTranslationInterface
  11. {
  12.     use ResourceTrait;
  13.     use TimestampableTrait;
  14.     use CreatedByAwareTrait;
  15.     use UpdatedByAwareTrait;
  16.     /**
  17.      * @ORM\ManyToOne(targetEntity="App\Entity\Location", inversedBy="locationTranslations")
  18.      * @ORM\JoinColumn(name="location_id", nullable=false)
  19.      */
  20.     private ?LocationInterface $location null;
  21.     /**
  22.      * @ORM\Column(type="string", length=255, nullable=false)
  23.      */
  24.     private ?string $locale null;
  25.     /**
  26.      * @ORM\Column(type="string", length=255, nullable=true)
  27.      */
  28.     private ?string $headquarter null;
  29.     /**
  30.      * @ORM\Column(type="text", nullable=true)
  31.      */
  32.     private ?string $description null;
  33.     /**
  34.      * @ORM\Column(type="string", length=255, nullable=false)
  35.      */
  36.     private ?string $city null;
  37.     public function __toString(): string
  38.     {
  39.         return sprintf('%s (%s)'$this->location$this->locale);
  40.     }
  41.     public function getLocation(): ?LocationInterface
  42.     {
  43.         return $this->location;
  44.     }
  45.     public function setLocation(?LocationInterface $location): void
  46.     {
  47.         $this->location $location;
  48.     }
  49.     public function getLocale(): ?string
  50.     {
  51.         return $this->locale;
  52.     }
  53.     public function setLocale(?string $locale): void
  54.     {
  55.         $this->locale $locale;
  56.     }
  57.     public function getHeadquarter(): ?string
  58.     {
  59.         return $this->headquarter;
  60.     }
  61.     public function setHeadquarter(?string $headquarter): void
  62.     {
  63.         $this->headquarter $headquarter;
  64.     }
  65.     public function getDescription(): ?string
  66.     {
  67.         return $this->description;
  68.     }
  69.     public function setDescription(?string $description): void
  70.     {
  71.         $this->description $description;
  72.     }
  73.     public function getCity(): ?string
  74.     {
  75.         return $this->city;
  76.     }
  77.     public function setCity(?string $city): void
  78.     {
  79.         $this->city $city;
  80.     }
  81. }