<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\DocumentRepository")
*/
class Document
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string")
*/
private $reference;
/**
* @ORM\Column(type="string", nullable = true, length=255)
*/
private $libelle;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $version;
/**
* @ORM\Column(type="string", nullable = true, length=255)
*/
private $niveau;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="documents")
*/
private $redacteur;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="documentApprouves")
*/
private $approuverPar;
/**
* @ORM\Column(type="string", nullable = true, length=255)
*/
private $service;
/**
* @ORM\Column(type="string", nullable = true, length=255)
*/
private $status;
/**
* @ORM\Column(type="string", nullable = true, length=255)
*/
private $brochureFilename;
/**
* @ORM\Column(type="datetime")
*/
private $createdAt;
public function __construct(){
$this->createdAt = new \DateTime('now');
if (!isset($this->reference)){
$this->reference = 'DOC'.random_int(1,99).date('s');
}else{
$this->reference = 'DOC'.random_int(1,99).date('s');
}
}
/**
* @return mixed
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* @param mixed $createdAt
* @return Abonne
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
public function getBrochureFilename(): ?string
{
return $this->brochureFilename;
}
public function setBrochureFilename(?string $brochureFilename): self
{
$this->brochureFilename = $brochureFilename;
return $this;
}
/**
* @return mixed
*/
public function getId(): ?int
{
return $this->id;
}
/**
* @return mixed
*/
public function getReference(): string
{
return $this->reference;
}
/**
* @param mixed $reference
* @return Document
*/
public function setReference(?string $reference): self
{
$this->reference = $reference;
return $this;
}
/**
* @return mixed
*/
public function getService(): ?string
{
return $this->service;
}
/**
* @param mixed $service
* @return Document
*/
public function setService(?string $service): self
{
$this->service = $service;
return $this;
}
/**
* @return mixed
*/
public function getRedacteur(): ?User
{
return $this->redacteur;
}
/**
* @param mixed $redacteur
* @return Document
*/
public function setRedacteur(?User $redacteur): self
{
$this->redacteur = $redacteur;
return $this;
}
/**
* @return mixed
*/
public function getApprouverPar(): ?User
{
return $this->approuverPar;
}
/**
* @param mixed $approuverPar
* @return Document
*/
public function setApprouverPar(?User $approuverPar): self
{
$this->approuverPar = $approuverPar;
return $this;
}
/**
* @return mixed
*/
public function getStatus(): ?string
{
return $this->status;
}
/**
* @param mixed $status
* @return Document
*/
public function setStatus(?string $status): self
{
$this->status = $status;
return $this;
}
/**
* @return mixed
*/
public function getLibelle(): ?string
{
return $this->libelle;
}
/**
* @param mixed $libelle
* @return Document
*/
public function setLibelle(?string $libelle): self
{
$this->libelle = $libelle;
return $this;
}
/**
* @return mixed
*/
public function getVersion(): ?string
{
return $this->version;
}
/**
* @param mixed $version
* @return Document
*/
public function setVersion(?string $version): self
{
$this->version = $version;
return $this;
}
/**
* @return mixed
*/
public function getNiveau(): ?string
{
return $this->niveau;
}
/**
* @param mixed $niveau
* @return Document
*/
public function setNiveau(?string $niveau): self
{
$this->niveau = $niveau;
return $this;
}
}