src/Entity/TrendVideo.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TrendVideoRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=TrendVideoRepository::class)
  7.  */
  8. class TrendVideo
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\ManyToOne(targetEntity=Video::class)
  18.      * @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
  19.      */
  20.     private $video;
  21.     /**
  22.      * @ORM\Column(type="datetime_immutable")
  23.      */
  24.     private $created_at;
  25.     public function __construct($video)
  26.     {
  27.         $this->video $video;
  28.         $this->created_at = new \DateTimeImmutable();
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getVideo(): ?Video
  35.     {
  36.         return $this->video;
  37.     }
  38.     public function setVideo(?Video $video): self
  39.     {
  40.         $this->video $video;
  41.         return $this;
  42.     }
  43.     public function getCreatedAt(): ?\DateTimeImmutable
  44.     {
  45.         return $this->created_at;
  46.     }
  47.     public function setCreatedAt(\DateTimeImmutable $created_at): self
  48.     {
  49.         $this->created_at $created_at;
  50.         return $this;
  51.     }
  52. }