src/Entity/TourPoi.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CategoryRepository;
  4. use DateTime;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use JMS\Serializer\Annotation as Serializer;
  10. /**
  11.  * @ORM\Entity
  12.  * @ORM\Table(name="tour_pois")
  13.  */
  14. #[ORM\Entity]
  15. #[ORM\Table("poi_tour")]
  16. class TourPoi
  17. {
  18.     #[ORM\Id]
  19.     #[ORM\GeneratedValue]
  20.     #[ORM\Column]
  21.     private ?int $id null;
  22.     #[ORM\ManyToOne(targetEntityTour::class, inversedBy:"pois",cascade:["remove"])]
  23.     #[ORM\JoinColumn(name:"tour_id",onDelete:"cascade")]
  24.     #[ORM\OrderBy(["sortorder"=>"ASC"])]
  25.     #[Serializer\Groups(["category","poi","tour"])]
  26.     private $tour;
  27.     #[ORM\ManyToOne(targetEntityPOI::class, inversedBy:"tours",cascade:["remove"])]
  28.     #[ORM\JoinColumn(name:"poi_id",onDelete:"cascade")]
  29.     #[ORM\OrderBy(["sortorder"=>"ASC"])]
  30.     #[Serializer\Groups(["category","poi","tour"])]
  31.     private $poi;
  32.     #[ORM\Column(nullabletrue)]
  33.     private ?int $sortorder;
  34.     public function __construct()
  35.     {
  36.     }
  37.     public function __toString() {
  38.         
  39.         return $this->poi->getTitle();
  40.     }
  41.     public function getId(): ?int
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function getTour(): ?Tour
  46.     {
  47.         return $this->tour;
  48.        
  49.     }
  50.     public function setTour(?Tour $tour): self
  51.     {
  52.         $this->tour $tour;
  53.     
  54.         return $this;
  55.     }
  56.     public function getPoi(): ?POI
  57.     {
  58.         return $this->poi;
  59.        
  60.     }
  61.     public function setPoi(?POI $poi): self
  62.     {       
  63.         $this->poi $poi;
  64.     
  65.         return $this;
  66.     }
  67.     public function getSortorder(): ?int
  68.     {
  69.         return $this->sortorder;
  70.        
  71.     }
  72.     public function setSortorder(?int $sortorder): self
  73.     {        
  74.         $this->sortorder $sortorder;
  75.     
  76.         return $this;
  77.     }
  78. }