src/Entity/Slave/ClientFile.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Slave;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Table(name="eposm_s_client_file")
  9.  * @ORM\Entity
  10.  */
  11. class ClientFile
  12. {    
  13.     public function __toString()
  14.     {
  15.         return $this->getName();
  16.     }
  17.     public function displayType(){
  18.         switch($this->getType()){
  19.             case 'pdf': return 'PDF'; break;
  20.             case 'video': return 'Video'; break;
  21.             case 'image': return 'Immagine'; break;
  22.             case 'file': return 'Altro'; break;
  23.             default: break;
  24.         }
  25.     }
  26.     /**
  27.      * @ORM\Column(name="id", type="bigint")
  28.      * @ORM\Id
  29.      * @ORM\GeneratedValue(strategy="AUTO")
  30.      */
  31.     protected $id;
  32.     
  33.     /**
  34.      * @ORM\Column(name="datetime", type="datetime")
  35.      */
  36.     protected $datetime;
  37.     
  38.     /**
  39.      * @ORM\Column(name="name", type="string", length=191)
  40.      */
  41.     protected $name;
  42.     /**
  43.      * @ORM\Column(name="type", type="string", length=191)
  44.      */
  45.     protected $type;
  46.     /**
  47.      * @ORM\Column(name="file_path", type="string", length=191)
  48.      */
  49.     protected $filePath;
  50.         
  51.     // ManyToOne
  52.         /**
  53.          * @ORM\ManyToOne(targetEntity="App\Entity\Slave\Client", inversedBy="files")
  54.          * @ORM\JoinColumn(name="client_id", referencedColumnName="id")
  55.          */
  56.         private $client;
  57.     //
  58.     public function getId(): ?string
  59.     {
  60.         return $this->id;
  61.     }
  62.     public function getDatetime(): ?\DateTimeInterface
  63.     {
  64.         return $this->datetime;
  65.     }
  66.     public function setDatetime(\DateTimeInterface $datetime): static
  67.     {
  68.         $this->datetime $datetime;
  69.         return $this;
  70.     }
  71.     public function getName(): ?string
  72.     {
  73.         return $this->name;
  74.     }
  75.     public function setName(string $name): static
  76.     {
  77.         $this->name $name;
  78.         return $this;
  79.     }
  80.     public function getFilePath(): ?string
  81.     {
  82.         return $this->filePath;
  83.     }
  84.     public function setFilePath(string $filePath): static
  85.     {
  86.         $this->filePath $filePath;
  87.         return $this;
  88.     }
  89.     public function getClient(): ?Client
  90.     {
  91.         return $this->client;
  92.     }
  93.     public function setClient(?Client $client): static
  94.     {
  95.         $this->client $client;
  96.         return $this;
  97.     }
  98.     public function getType(): ?string
  99.     {
  100.         return $this->type;
  101.     }
  102.     public function setType(string $type): static
  103.     {
  104.         $this->type $type;
  105.         return $this;
  106.     }
  107. }