src/Entity/Picture.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Traits\CreatedUpdatedTrait;
  5. use JMS\Serializer\Annotation as Serializer;
  6. use JMS\Serializer\Annotation\Expose;
  7. use App\Repository\PictureRepository;
  8. /**
  9.  * @ORM\Table(name="v_picture")
  10.  * @ORM\Entity(repositoryClass=PictureRepository::class)
  11.  */
  12. class Picture
  13. {
  14.     const VIEW_FRONT 'FRONT';
  15.     const VIEW_TOP 'TOP';
  16.     const VIEW_RIGHT 'RIGHT';
  17.     const VIEW_LEFT 'LEFT';
  18.     const VIEW_BACK 'BACK';
  19.     public static function getViewDefinitions(){
  20.         return [
  21.             self::VIEW_FRONT => 'Front',
  22.             self::VIEW_TOP => 'Top',
  23.             self::VIEW_RIGHT => 'Right',
  24.             self::VIEW_LEFT => 'Left',
  25.             self::VIEW_BACK => 'Back',
  26.         ];
  27.     }
  28.     /**
  29.      * @ORM\Id
  30.      * @ORM\GeneratedValue
  31.      * @ORM\Column(type="integer")
  32.      */
  33.     private $id;
  34.      /**
  35.      * @ORM\Column(type="string", length=255, nullable=true)
  36.      * @Expose
  37.      *
  38.      * @var string
  39.      */
  40.     private $batchId;
  41.     /**
  42.      * @ORM\Column(type="string", length=255, nullable=true)
  43.      * @Expose
  44.      *
  45.      * @var string
  46.      */
  47.     private $imageName;
  48.     /**
  49.      * @ORM\Column(type="string", length=255, nullable=true)
  50.      * @Expose
  51.      */
  52.     private $view;
  53.     /**
  54.      * @ORM\ManyToOne(targetEntity="App\Entity\User")
  55.      * @Serializer\Type("Relation")
  56.      */
  57.     private $user;
  58.     /**
  59.      * @ORM\ManyToOne(targetEntity="App\Entity\TreatmentActivity")
  60.      * @Serializer\Type("Relation")
  61.      */
  62.     private $treatmentActivity;
  63.     use CreatedUpdatedTrait;
  64.     public function getId(): ?int
  65.     {
  66.         return $this->id;
  67.     }
  68.     public function setBatchId($batchId)
  69.     {
  70.         $this->batchId $batchId;
  71.     }
  72.     public function getBatchId()
  73.     {
  74.         return $this->batchId;
  75.     }
  76.     /**
  77.      * @param string $imageName
  78.      */
  79.     public function setImageName($imageName)
  80.     {
  81.         $this->imageName $imageName;
  82.     }
  83.     /**
  84.      * @return string
  85.      */
  86.     public function getImageName()
  87.     {
  88.         return $this->imageName;
  89.     }
  90.     /**
  91.      * @return mixed
  92.      */
  93.     public function getUser()
  94.     {
  95.         return $this->user;
  96.     }
  97.     /**
  98.      * @param mixed $user
  99.      */
  100.     public function setUser($user): void
  101.     {
  102.         $this->user $user;
  103.     }
  104.     /**
  105.      * @return mixed
  106.      */
  107.     public function getTreatmentActivity()
  108.     {
  109.         return $this->treatmentActivity;
  110.     }
  111.     /**
  112.      * @param mixed $treatmentActivity
  113.      */
  114.     public function setTreatmentActivity($treatmentActivity): void
  115.     {
  116.         $this->treatmentActivity $treatmentActivity;
  117.     }
  118.     /**
  119.      * @return mixed
  120.      */
  121.     public function getView()
  122.     {
  123.         return $this->view;
  124.     }
  125.     /**
  126.      * @param mixed $view
  127.      */
  128.     public function setView($view): void
  129.     {
  130.         $this->view $view;
  131.     }
  132. }