src/Entity/LocationDetail.php line 13
<?phpnamespace App\Entity;use App\Repository\LocationDetailRepository;use Doctrine\ORM\Mapping as ORM;/*** @ORM\Entity(repositoryClass=LocationDetailRepository::class)* @ORM\Table(name="location_detail")* @ORM\HasLifecycleCallbacks()*/class LocationDetail{public const TYPE_TEXT = 'text';public const TYPE_AUDIO = 'audio';public const TYPE_VIDEO = 'video';public const TYPES = [self::TYPE_TEXT,self::TYPE_AUDIO,self::TYPE_VIDEO,];/*** @ORM\Id* @ORM\GeneratedValue* @ORM\Column(type="integer")*/private ?int $id = null;/*** @ORM\ManyToOne(targetEntity=Location::class, inversedBy="details")* @ORM\JoinColumn(nullable=false)*/private Location $location;/*** "text", "audio" or "video"* @ORM\Column(type="string", length=10)*/private string $type;/*** @ORM\Column(type="string", length=200)*/private string $title;/*** Stores the body for type=text, or a transcript for audio/video* @ORM\Column(type="text", nullable=true)*/private ?string $content = null;/*** Relative storage path for audio/video files (e.g. S3 key or local path)* @ORM\Column(type="string", length=500, nullable=true)*/private ?string $filePath = null;/*** ISO 639-1 language code, e.g. "en", "hy", "fr"* @ORM\Column(type="string", length=5, nullable=true)*/private ?string $language = null;/*** Display order among siblings on the same location* @ORM\Column(type="integer", options={"default": 0})*/private int $sortOrder = 0;/*** @ORM\Column(type="boolean", options={"default": true})*/private bool $isActive = true;/*** @ORM\Column(type="datetime_immutable")*/private \DateTimeImmutable $createdAt;/*** @ORM\Column(type="datetime_immutable", nullable=true)*/private ?\DateTimeImmutable $updatedAt = null;public function __construct(){$this->createdAt = new \DateTimeImmutable();}/*** @ORM\PreUpdate()*/public function onPreUpdate(): void{$this->updatedAt = new \DateTimeImmutable();}public function getId(): ?int{return $this->id;}public function getLocation(): Location{return $this->location;}public function setLocation(?Location $location): self{$this->location = $location;return $this;}public function getType(): string{return $this->type;}public function setType(string $type): self{if (!in_array($type, self::TYPES, true)) {throw new \InvalidArgumentException(sprintf('Invalid type "%s". Allowed: %s',$type,implode(', ', self::TYPES)));}$this->type = $type;return $this;}public function getTitle(): string{return $this->title;}public function setTitle(string $title): self{$this->title = $title;return $this;}public function getContent(): ?string{return $this->content;}public function setContent(?string $content): self{$this->content = $content;return $this;}public function getFilePath(): ?string{return $this->filePath;}public function setFilePath(?string $filePath): self{$this->filePath = $filePath;return $this;}public function getLanguage(): ?string{return $this->language;}public function setLanguage(?string $language): self{$this->language = $language;return $this;}public function getSortOrder(): int{return $this->sortOrder;}public function setSortOrder(int $sortOrder): self{$this->sortOrder = $sortOrder;return $this;}public function isActive(): bool{return $this->isActive;}public function setIsActive(bool $isActive): self{$this->isActive = $isActive;return $this;}public function getCreatedAt(): \DateTimeImmutable{return $this->createdAt;}public function getUpdatedAt(): ?\DateTimeImmutable{return $this->updatedAt;}}