src/Entity/Project.php line 12
<?php
namespace App\Entity;
use App\Repository\ProjectRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ProjectRepository::class)]
class Project
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
private $title;
#[ORM\Column(type: 'text', nullable: true)]
private $content;
#[ORM\Column(type: 'date')]
private $date_debut;
#[ORM\Column(type: 'date', nullable: true)]
private $date_fin;
#[ORM\Column(type: 'datetime')]
private $date_upload;
#[ORM\ManyToMany(targetEntity: Image::class, inversedBy: 'projects')]
private $image;
#[ORM\OneToOne(targetEntity: Image::class, cascade: ['persist', 'remove'])]
private $thumbnail_image;
#[ORM\Column(type: 'boolean')]
private $online;
#[ORM\ManyToMany(targetEntity: Tag::class, mappedBy: 'Project')]
private Collection $tags;
public function __construct()
{
$this->image = new ArrayCollection();
$this->tags = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(?string $content): self
{
$this->content = $content;
return $this;
}
public function getDateDebut(): ?\DateTimeInterface
{
return $this->date_debut;
}
public function setDateDebut(\DateTimeInterface $date_debut): self
{
$this->date_debut = $date_debut;
return $this;
}
public function getDateFin(): ?\DateTimeInterface
{
return $this->date_fin;
}
public function setDateFin(?\DateTimeInterface $date_fin): self
{
$this->date_fin = $date_fin;
return $this;
}
public function getDateUpload(): ?\DateTimeInterface
{
return $this->date_upload;
}
public function setDateUpload(\DateTimeInterface $date_upload): self
{
$this->date_upload = $date_upload;
return $this;
}
/**
* @return Collection|Image[]
*/
public function getImage(): Collection
{
return $this->image;
}
public function addImage(Image $image): self
{
if (!$this->image->contains($image)) {
$this->image[] = $image;
}
return $this;
}
public function removeImage(Image $image): self
{
$this->image->removeElement($image);
return $this;
}
public function getThumbnailImage(): ?Image
{
return $this->thumbnail_image;
}
public function setThumbnailImage(?Image $thumbnail_image): self
{
$this->thumbnail_image = $thumbnail_image;
return $this;
}
public function getOnline(): ?bool
{
return $this->online;
}
public function setOnline(bool $online): self
{
$this->online = $online;
return $this;
}
public function isOnline(): ?bool
{
return $this->online;
}
/**
* @return Collection<int, Tag>
*/
public function getTags(): Collection
{
return $this->tags;
}
public function addTag(Tag $tag): self
{
if (!$this->tags->contains($tag)) {
$this->tags->add($tag);
$tag->addProject($this);
}
return $this;
}
public function removeTag(Tag $tag): self
{
if ($this->tags->removeElement($tag)) {
$tag->removeProject($this);
}
return $this;
}
}