<?php/* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */namespace App\Entity;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;use Symfony\Component\Validator\Constraints as Assert;/** * @ORM\Entity() * @ORM\Table(name="hebergement") * * Defines the properties of the Tag entity to represent the subcategory tags. * * See https://symfony.com/doc/current/doctrine.html#creating-an-entity-class * * @author Yonel Ceruto <yonelceruto@gmail.com> */class Hebergement { /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private ?int $id = null; /** * @ORM\Column(type="string", nullable=true) */ private ?string $name = null; /** * @ORM\Column(type="string", nullable=true) */ private ?string $description = null; /** * @ORM\Column(type="boolean") */ private $published; /** * @ORM\Column(type="string", nullable=true) */ private ?string $ordre = null; /** * @ORM\Column(type="string", nullable=true) */ private ?string $price = null; /** * @ORM\Column(type="string", nullable=true) */ private ?string $image = null; /** * @ORM\OneToMany(targetEntity="App\Entity\Media", mappedBy="hebergement",orphanRemoval=true)) * @ORM\OrderBy({"id": "DESC"}) */ private Collection $medias; /** * @ORM\ManyToOne(targetEntity="App\Entity\Experience", inversedBy="hebergements") */ private $experience; public function __construct() { $this->experiences = new ArrayCollection(); $this->medias = new ArrayCollection(); $this->published = 1; } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function getDescription(): ?string { return $this->description; } public function getPublished() { return $this->published; } public function getOrdre(): ?string { return $this->ordre; } public function getPrice(): ?string { return $this->price; } public function getImage(): ?string { return $this->image; } public function getMedias(): Collection { return $this->medias; } public function getExperience() { return $this->experience; } public function setId(?int $id): void { $this->id = $id; } public function setName(?string $name): void { $this->name = $name; } public function setDescription(?string $description): void { $this->description = $description; } public function setPublished($published): void { $this->published = $published; } public function setOrdre(?string $ordre): void { $this->ordre = $ordre; } public function setPrice(?string $price): void { $this->price = $price; } public function setImage(?string $image): void { $this->image = $image; } public function setMedias(Collection $medias): void { $this->medias = $medias; } public function setExperience($experience): void { $this->experience = $experience; } public function addMedia(Media $media): void { $media->setHebergement($this); if (!$this->medias->contains($media)) { $this->medias->add($media); } } public function removeMedia(Media $media): void { $this->medias->removeElement($media); }}