src/Entity/RecipeCount.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\RecipeCountRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. #[ORM\Entity(repositoryClassRecipeCountRepository::class)]
  9. class RecipeCount
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     #[Groups(["show_recipe_count","list_recipes""show_recipe"])]
  17.     private ?string $identifiant null;
  18.     #[ORM\Column(length255)]
  19.     private ?string $user null;
  20.     #[ORM\Column(length255)]
  21.     #[Groups(["show_recipe_count","list_recipes""show_recipe"])]
  22.     private ?string $rf null;
  23.     #[ORM\ManyToMany(targetEntityRecipe::class, inversedBy'recipeCounts')]
  24.     private Collection $recipe;
  25.     #[ORM\Column(length255)]
  26.     private ?string $number null;
  27.     #[ORM\ManyToMany(targetEntityUser::class, inversedBy'recipeCounts')]
  28.     private Collection $visitor;
  29.     public function __construct()
  30.     {
  31.         $this->recipe = new ArrayCollection();
  32.         $this->visitor = new ArrayCollection();
  33.     }
  34.     public function getId(): ?int
  35.     {
  36.         return $this->id;
  37.     }
  38.     public function getIdentifiant(): ?string
  39.     {
  40.         return $this->identifiant;
  41.     }
  42.     public function setIdentifiant(string $identifiant): self
  43.     {
  44.         $this->identifiant $identifiant;
  45.         return $this;
  46.     }
  47.     public function getUser(): ?string
  48.     {
  49.         return $this->user;
  50.     }
  51.     public function setUser(string $user): self
  52.     {
  53.         $this->user $user;
  54.         return $this;
  55.     }
  56.     public function getRf(): ?string
  57.     {
  58.         return $this->rf;
  59.     }
  60.     public function setRf(string $rf): self
  61.     {
  62.         $this->rf $rf;
  63.         return $this;
  64.     }
  65.     /**
  66.      * @return Collection<int, Recipe>
  67.      */
  68.     public function getRecipe(): Collection
  69.     {
  70.         return $this->recipe;
  71.     }
  72.     public function addRecipe(Recipe $recipe): self
  73.     {
  74.         if (!$this->recipe->contains($recipe)) {
  75.             $this->recipe->add($recipe);
  76.         }
  77.         return $this;
  78.     }
  79.     public function removeRecipe(Recipe $recipe): self
  80.     {
  81.         $this->recipe->removeElement($recipe);
  82.         return $this;
  83.     }
  84.     public function getNumber(): ?string
  85.     {
  86.         return $this->number;
  87.     }
  88.     public function setNumber(string $number): self
  89.     {
  90.         $this->number $number;
  91.         return $this;
  92.     }
  93.     /**
  94.      * @return Collection<int, User>
  95.      */
  96.     public function getVisitor(): Collection
  97.     {
  98.         return $this->visitor;
  99.     }
  100.     public function addVisitor(User $visitor): self
  101.     {
  102.         if (!$this->visitor->contains($visitor)) {
  103.             $this->visitor->add($visitor);
  104.         }
  105.         return $this;
  106.     }
  107.     public function removeVisitor(User $visitor): self
  108.     {
  109.         $this->visitor->removeElement($visitor);
  110.         return $this;
  111.     }
  112. }