src/Entity/UserConnection.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserConnectionRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassUserConnectionRepository::class)]
  6. class UserConnection
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'userConnections')]
  13.     #[ORM\JoinColumn(nullablefalse)]
  14.     private $user;
  15.     #[ORM\ManyToOne(targetEntityUser::class)]
  16.     #[ORM\JoinColumn(nullablefalse)]
  17.     private $following_user;
  18.     #[ORM\Column(type'datetime')]
  19.     private $created_at;
  20.     #[ORM\Column(type'datetime'nullabletrue)]
  21.     private $updated_at;
  22.     public function __construct() {
  23.         $this->created_at = new \DateTime();
  24.     }
  25.     public function getId(): ?int
  26.     {
  27.         return $this->id;
  28.     }
  29.     public function getUser(): ?User
  30.     {
  31.         return $this->user;
  32.     }
  33.     public function setUser(?User $user): self
  34.     {
  35.         $this->user $user;
  36.         return $this;
  37.     }
  38.     public function getFollowingUser(): ?User
  39.     {
  40.         return $this->following_user;
  41.     }
  42.     public function setFollowingUser(?User $following_user): self
  43.     {
  44.         $this->following_user $following_user;
  45.         return $this;
  46.     }
  47.     public function getCreatedAt(): ?\DateTimeInterface
  48.     {
  49.         return $this->created_at;
  50.     }
  51.     public function setCreatedAt(\DateTimeInterface $created_at): self
  52.     {
  53.         $this->created_at $created_at;
  54.         return $this;
  55.     }
  56.     public function getUpdatedAt(): ?\DateTimeInterface
  57.     {
  58.         return $this->updated_at;
  59.     }
  60.     public function setUpdatedAt(?\DateTimeInterface $updated_at): self
  61.     {
  62.         $this->updated_at $updated_at;
  63.         return $this;
  64.     }
  65. }