<?php
namespace App\Entity;
use App\Repository\TrendVideoRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=TrendVideoRepository::class)
*/
class TrendVideo
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity=Video::class)
* @ORM\JoinColumn(nullable=false, onDelete="CASCADE")
*/
private $video;
/**
* @ORM\Column(type="datetime_immutable")
*/
private $created_at;
public function __construct($video)
{
$this->video = $video;
$this->created_at = new \DateTimeImmutable();
}
public function getId(): ?int
{
return $this->id;
}
public function getVideo(): ?Video
{
return $this->video;
}
public function setVideo(?Video $video): self
{
$this->video = $video;
return $this;
}
public function getCreatedAt(): ?\DateTimeImmutable
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeImmutable $created_at): self
{
$this->created_at = $created_at;
return $this;
}
}