src/Entity/TagConnection.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TagConnectionRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassTagConnectionRepository::class)]
  6. class TagConnection
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'tagConnections')]
  13.     #[ORM\JoinColumn(nullablefalse)]
  14.     private $user;
  15.     #[ORM\ManyToOne(targetEntityTag::class)]
  16.     #[ORM\JoinColumn(nullablefalse)]
  17.     private $tag;
  18.     #[ORM\Column(type'datetime')]
  19.     private $createdAt;
  20.     public function __construct() {
  21.         $this->createdAt = new \DateTime();
  22.     }
  23.     public function getId(): ?int
  24.     {
  25.         return $this->id;
  26.     }
  27.     public function getUser(): ?User
  28.     {
  29.         return $this->user;
  30.     }
  31.     public function setUser(?User $user): self
  32.     {
  33.         $this->user $user;
  34.         return $this;
  35.     }
  36.     public function getTag(): ?Tag
  37.     {
  38.         return $this->tag;
  39.     }
  40.     public function setTag(?Tag $tag): self
  41.     {
  42.         $this->tag $tag;
  43.         return $this;
  44.     }
  45.     public function getCreatedAt(): ?\DateTimeInterface
  46.     {
  47.         return $this->createdAt;
  48.     }
  49.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  50.     {
  51.         $this->createdAt $createdAt;
  52.         return $this;
  53.     }
  54. }