<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Repository\MediaRepository;
use App\Entity\Traits\Timestampable;
#[ORM\Entity(repositoryClass: MediaRepository::class)]
#[ORM\HasLifecycleCallbacks]
class Media
{
use Timestampable;
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $nomImage = null;
#[ORM\ManyToOne(inversedBy: 'media', cascade: ['persist'])]
#[ORM\JoinColumn(nullable: false)]
private ?Publication $publication = null;
public function getId(): ?int
{
return $this->id;
}
public function getNomImage(): ?string
{
return $this->nomImage;
}
public function setNomImage(string $nomImage): static
{
$this->nomImage = $nomImage;
return $this;
}
public function getPublication(): ?Publication
{
return $this->publication;
}
public function setPublication(?Publication $publication): static
{
$this->publication = $publication;
return $this;
}
}