<?php
namespace App\Entity\Slave;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="eposm_s_client_file")
* @ORM\Entity
*/
class ClientFile
{
public function __toString()
{
return $this->getName();
}
public function displayType(){
switch($this->getType()){
case 'pdf': return 'PDF'; break;
case 'video': return 'Video'; break;
case 'image': return 'Immagine'; break;
case 'file': return 'Altro'; break;
default: break;
}
}
/**
* @ORM\Column(name="id", type="bigint")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(name="datetime", type="datetime")
*/
protected $datetime;
/**
* @ORM\Column(name="name", type="string", length=191)
*/
protected $name;
/**
* @ORM\Column(name="type", type="string", length=191)
*/
protected $type;
/**
* @ORM\Column(name="file_path", type="string", length=191)
*/
protected $filePath;
// ManyToOne
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Slave\Client", inversedBy="files")
* @ORM\JoinColumn(name="client_id", referencedColumnName="id")
*/
private $client;
//
public function getId(): ?string
{
return $this->id;
}
public function getDatetime(): ?\DateTimeInterface
{
return $this->datetime;
}
public function setDatetime(\DateTimeInterface $datetime): static
{
$this->datetime = $datetime;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getFilePath(): ?string
{
return $this->filePath;
}
public function setFilePath(string $filePath): static
{
$this->filePath = $filePath;
return $this;
}
public function getClient(): ?Client
{
return $this->client;
}
public function setClient(?Client $client): static
{
$this->client = $client;
return $this;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(string $type): static
{
$this->type = $type;
return $this;
}
}