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.         public function getId(): ?string
  58.         {
  59.             return $this->id;
  60.         }
  61.         public function getDatetime(): ?\DateTimeInterface
  62.         {
  63.             return $this->datetime;
  64.         }
  65.         public function setDatetime(\DateTimeInterface $datetime): static
  66.         {
  67.             $this->datetime $datetime;
  68.             return $this;
  69.         }
  70.         public function getName(): ?string
  71.         {
  72.             return $this->name;
  73.         }
  74.         public function setName(string $name): static
  75.         {
  76.             $this->name $name;
  77.             return $this;
  78.         }
  79.         public function getFilePath(): ?string
  80.         {
  81.             return $this->filePath;
  82.         }
  83.         public function setFilePath(string $filePath): static
  84.         {
  85.             $this->filePath $filePath;
  86.             return $this;
  87.         }
  88.         public function getClient(): ?Client
  89.         {
  90.             return $this->client;
  91.         }
  92.         public function setClient(?Client $client): static
  93.         {
  94.             $this->client $client;
  95.             return $this;
  96.         }
  97.     public function getType(): ?string
  98.     {
  99.         return $this->type;
  100.     }
  101.     public function setType(string $type): static
  102.     {
  103.         $this->type $type;
  104.         return $this;
  105.     }
  106. }