src/Entity/CategoryPoi.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="category_pois")
  13.  */
  14. #[ORM\Entity]
  15. #[ORM\Table("category_poi")]
  16. class CategoryPoi
  17. {
  18.     #[ORM\Id]
  19.     #[ORM\GeneratedValue]
  20.     #[ORM\Column]
  21.     private ?int $id null;
  22.     #[ORM\ManyToOne(targetEntityCategory::class, inversedBy:"pois",cascade:["persist"])]
  23.     #[ORM\JoinColumn(name:"category_id")]
  24.     #[ORM\OrderBy(["sortorder"=>"ASC"])]    
  25.     private $category;
  26.     #[ORM\ManyToOne(targetEntityPOI::class, inversedBy:"categories",cascade:["persist"])]
  27.     #[ORM\JoinColumn(name:"poi_id")]    
  28.     #[ORM\OrderBy(["sortorder"=>"ASC"])]
  29.     #[Serializer\Groups(["category","poi","tour"])]
  30.     private $poi;
  31.     #[ORM\Column(nullabletrue)]
  32.     private ?int $sortorder;
  33.     public function __construct()
  34.     {
  35.     }
  36.     public function __toString() {
  37.         
  38.         return $this->poi->getTitle();
  39.     }
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getCategory(): ?Category
  45.     {
  46.         return $this->category;
  47.        
  48.     }
  49.     public function setCategory(?Category $category): self
  50.     {
  51.         $this->category $category;
  52.     
  53.         return $this;
  54.     }
  55.     public function getPoi(): ?POI
  56.     {
  57.         return $this->poi;
  58.        
  59.     }
  60.     public function setPoi(?POI $poi): self
  61.     {        
  62.         $this->poi $poi;
  63.     
  64.         return $this;
  65.     }
  66.     public function getSortorder(): ?int
  67.     {
  68.         return $this->sortorder;
  69.        
  70.     }
  71.     public function setSortorder(?int $sortorder): self
  72.     {        
  73.         $this->sortorder $sortorder;
  74.     
  75.         return $this;
  76.     }
  77. }