src/Entity/Package.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PackageRepository;
  4. use App\Traits\CreatedUpdatedTrait;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use JMS\Serializer\Annotation as Serializer;
  7. /**
  8.  * @ORM\Table(name="v_package")
  9.  * @ORM\Entity(repositoryClass=PackageRepository::class)
  10.  */
  11. class Package
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\ManyToOne(targetEntity="Clinic")
  21.      * @Serializer\Exclude()
  22.      */
  23.     private $clinic;
  24.     /**
  25.      * @ORM\Column(type="string", length=255)
  26.      */
  27.     private $name;
  28.     /**
  29.      * @var array
  30.      * @ORM\Column(name="design", type="json", nullable=true)
  31.      */
  32.     private $design;
  33.     /**
  34.      * @ORM\Column(type="text", nullable=true)
  35.      */
  36.     private $description;
  37.     /**
  38.      * @ORM\Column(type="boolean")
  39.      */
  40.     private $isPublic;
  41.     /**
  42.      * @ORM\ManyToOne(targetEntity=PackageCategory::class, inversedBy="packages")
  43.      */
  44.     private $category;
  45.     /**
  46.      * @ORM\Column(type="json", nullable=true)
  47.      */
  48.     private $activities = [];
  49.     /**
  50.      * @ORM\Column(type="date", nullable=true)
  51.      */
  52.     private $startDate;
  53.     use CreatedUpdatedTrait;
  54.     public function __toString(){
  55.         return $this->name;
  56.     }
  57.     public function getId(): ?int
  58.     {
  59.         return $this->id;
  60.     }
  61.     /**
  62.      * @return mixed
  63.      */
  64.     public function getClinic()
  65.     {
  66.         return $this->clinic;
  67.     }
  68.     /**
  69.      * @param mixed $clinic
  70.      */
  71.     public function setClinic($clinic): void
  72.     {
  73.         $this->clinic $clinic;
  74.     }
  75.     public function getName(): ?string
  76.     {
  77.         return $this->name;
  78.     }
  79.     public function setName(string $name): self
  80.     {
  81.         $this->name $name;
  82.         return $this;
  83.     }
  84.     /**
  85.      * @return array
  86.      */
  87.     public function getDesign(): array
  88.     {
  89.         return $this->design;
  90.     }
  91.     /**
  92.      * @param array $design
  93.      */
  94.     public function setDesign(array $design): void
  95.     {
  96.         $this->design $design;
  97.     }
  98.     public function getDescription(): ?string
  99.     {
  100.         return $this->description;
  101.     }
  102.     public function setDescription(?string $description): self
  103.     {
  104.         $this->description $description;
  105.         return $this;
  106.     }
  107.     public function isIsPublic(): ?bool
  108.     {
  109.         return $this->isPublic;
  110.     }
  111.     public function setIsPublic(bool $isPublic): self
  112.     {
  113.         $this->isPublic $isPublic;
  114.         return $this;
  115.     }
  116.     public function getCategory(): ?PackageCategory
  117.     {
  118.         return $this->category;
  119.     }
  120.     public function setCategory(?PackageCategory $category): self
  121.     {
  122.         $this->category $category;
  123.         return $this;
  124.     }
  125.     public function getActivities(): ?array
  126.     {
  127.         return $this->activities;
  128.     }
  129.     public function setActivities(?array $activities): self
  130.     {
  131.         $this->activities $activities;
  132.         return $this;
  133.     }
  134.     public function getStartDate(): ?\DateTimeInterface
  135.     {
  136.         return $this->startDate;
  137.     }
  138.     public function setStartDate(?\DateTimeInterface $startDate): self
  139.     {
  140.         $this->startDate $startDate;
  141.         return $this;
  142.     }
  143. }