<?php
namespace App\Entity;
use App\Repository\TagConnectionRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: TagConnectionRepository::class)]
class TagConnection
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'tagConnections')]
#[ORM\JoinColumn(nullable: false)]
private $user;
#[ORM\ManyToOne(targetEntity: Tag::class)]
#[ORM\JoinColumn(nullable: false)]
private $tag;
#[ORM\Column(type: 'datetime')]
private $createdAt;
public function __construct() {
$this->createdAt = new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getTag(): ?Tag
{
return $this->tag;
}
public function setTag(?Tag $tag): self
{
$this->tag = $tag;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
}