src/Entity/FavoriteCompany.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FavoriteCompanyRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. // /**
  7. //  * @ORM\Entity(repositoryClass=FavoriteCompanyRepository::class)
  8. //  */
  9. #[ORM\Entity(repositoryClassFavoriteCompanyRepository::class)]
  10. class FavoriteCompany
  11. {
  12.     // /**
  13.     //  * @var int
  14.     //  * @ORM\Column(name="id", type="integer", unique=true )
  15.     //  * @ORM\Id
  16.     //  * @ORM\GeneratedValue(strategy="AUTO")
  17.     //  */
  18.     #[ORM\Id]
  19.     #[ORM\Column(name"id"type"integer"uniquetrue)]
  20.     #[ORM\GeneratedValue(strategy"AUTO")]
  21.     private $id;
  22.     // /**
  23.     //  * @ORM\ManyToOne(targetEntity=User::class, inversedBy="favoriteCategories")
  24.     //  * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  25.     //  */
  26.     #[Groups("favorite")]
  27.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy"favoriteCategories")]
  28.     #[ORM\JoinColumn(nullablefalseonDelete"CASCADE")]
  29.     private $user;
  30.     // /**
  31.     //  * @ORM\ManyToOne(targetEntity=Company::class)
  32.     //  * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  33.     //  */
  34.   #[Groups(['company''category'"favorite"])]
  35.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy"favoriteCompanies")]
  36.     #[ORM\JoinColumn(nullablefalseonDelete"CASCADE")]
  37.     private $company;
  38.     public function getId(): ?int
  39.     {
  40.         return $this->id;
  41.     }
  42.     public function getUser(): ?User
  43.     {
  44.         return $this->user;
  45.     }
  46.     public function setUser(?User $user): self
  47.     {
  48.         $this->user $user;
  49.         return $this;
  50.     }
  51.     public function getCompany(): ?Company
  52.     {
  53.         return $this->company;
  54.     }
  55.     public function setCompany(?Company $company): self
  56.     {
  57.         $this->company $company;
  58.         return $this;
  59.     }
  60. }