<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity(repositoryClass=App\Repository\ProjectRepository::class)
* @ORM\Table(name="project", schema="bdnf", options={"comment":"Contient les projets"})
*/
class Project
{
public function __construct()
{
$this->images = new ArrayCollection();
}
public function __toString()
{
return $this->getTitle();
}
public function toArray()
{
return [
'id' => $this->getId(),
'code' => $this->getCode(),
'title' => $this->getTitle(),
'dateCreation' => $this->getDateCreation(),
'datePublication' => $this->getDatePublication(),
'fileName' => $this->getFileName(),
'active' => $this->getActive(),
'lastUpdate' => $this->getLastUpdate()
];
}
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer", options={"comment":"Identifiant unique du projet"})
*/
private $id;
/**
* @ORM\Column(type="boolean", options={"comment":"Indique si le projet est actif ou non"})
*/
private $active = true;
/**
* @ORM\Column(type="string",unique=true, options={"comment":"Code du projet"})
*/
private $code;
/**
* @ORM\Column(type="string", options={"comment":"Titre du projet"})
*/
private $title;
/**
* @ORM\Column(type="string", options={"comment":"Type du projet"})
*/
private $type;
/**
* @ORM\Column(type="string", options={"comment":"Nom du fichier"})
*/
private $fileName;
/**
* @Vich\UploadableField(mapping="fileName", fileNameProperty="fileName")
* @var File
*/
private $file;
/**
* @ORM\Column(type="datetime", nullable=true, options={"comment":"Date de création du projet"})
*/
private $dateCreation;
/**
* @ORM\Column(type="datetime", nullable=true, options={"comment":"Date de publication du projet"})
*/
private $datePublication;
/**
* @ORM\Column(type="datetime", nullable=true, options={"comment":"Date de la dernière mise à jour du projet"})
*/
private $lastUpdate;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
*/
public function setId($id): void
{
$this->id = $id;
}
/**
* @return mixed
*/
public function getActive()
{
return $this->active;
}
/**
* @param mixed $active
*/
public function setActive($active): void
{
$this->active = $active;
}
/**
* @return mixed
*/
public function getTitle()
{
return $this->title;
}
/**
* @param mixed $title
*/
public function setTitle($title): void
{
$this->title = $title;
}
/**
* @return mixed
*/
public function getFileName()
{
return $this->fileName;
}
/**
* @param mixed $fileName
*/
public function setFileName($fileName): void
{
$this->fileName = $fileName;
}
/**
* @return File
*/
public function getFile(): File
{
return $this->file;
}
/**
* @param File $file
*/
public function setFile(File $file): void
{
$this->file = $file;
}
/**
* @return mixed
*/
public function getDateCreation()
{
return $this->dateCreation;
}
/**
* @param mixed $dateCreation
*/
public function setDateCreation($dateCreation): void
{
$this->dateCreation = $dateCreation;
}
/**
* @return mixed
*/
public function getDatePublication()
{
return $this->datePublication;
}
/**
* @param mixed $datePublication
*/
public function setDatePublication($datePublication): void
{
$this->datePublication = $datePublication;
}
/**
* @return mixed
*/
public function getLastUpdate()
{
return $this->lastUpdate;
}
/**
* @param mixed $lastUpdate
*/
public function setLastUpdate($lastUpdate): void
{
$this->lastUpdate = $lastUpdate;
}
/**
* @return mixed
*/
public function getCode()
{
return $this->code;
}
/**
* @param mixed $code
*/
public function setCode($code): void
{
$this->code = $code;
}
/**
* @return mixed
*/
public function getType()
{
return $this->type;
}
/**
* @param mixed $type
*/
public function setType($type): void
{
$this->type = $type;
}
}