<?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(repositoryClass="App\Repository\CountryRepository") * @ORM\Table(name="country") * * Defines the properties of the Tag entity to represent the subcountry tags. * * See https://symfony.com/doc/current/doctrine.html#creating-an-entity-class * * @author Yonel Ceruto <yonelceruto@gmail.com> */class Country { /** * @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="boolean", nullable=true) */ private $published; /** * @ORM\Column(type="string", nullable=true) */ private ?string $image = null; /** * @ORM\Column(type="string", nullable=true) */ private ?string $ordre = null; /** * @ORM\Column(type="string", nullable=true) */ private ?string $color = null; /** * @ORM\Column(type="text", nullable=true) */ private ?string $description = null; /** * @ORM\OneToMany(targetEntity="App\Entity\Destination", mappedBy="country",orphanRemoval=true)) * @ORM\OrderBy({"id": "DESC"}) */ private Collection $destinations; public function __construct() { $this->destinations = new ArrayCollection(); } public function addDestination(Destination $destination): void { $destination->setCountry($this); if (!$this->destinations->contains($destination)) { $this->destinations->add($destination); } } public function removeDestination(Destination $destination): void { $this->destinations->removeElement($destination); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function getPublished() { return $this->published; } public function getImage(): ?string { return $this->image; } public function getOrdre(): ?string { return $this->ordre; } public function getColor(): ?string { return $this->color; } public function getDescription(): ?string { return $this->description; } public function getDestinations(): Collection { return $this->destinations; } public function setId(?int $id): void { $this->id = $id; } public function setName(?string $name): void { $this->name = $name; } public function setPublished($published): void { $this->published = $published; } public function setImage(?string $image): void { $this->image = $image; } public function setOrdre(?string $ordre): void { $this->ordre = $ordre; } public function setColor(?string $color): void { $this->color = $color; } public function setDescription(?string $description): void { $this->description = $description; } public function setDestinations(Collection $destinations): void { $this->destinations = $destinations; }}