src/Entity/TreatmentActivity.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TreatmentActivityRepository;
  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_treatment_activity",
  9.  *  indexes={
  10.  *    @ORM\Index(name="idx_description", columns={"description"}),
  11.  *    @ORM\Index(name="idx_name", columns={"name"}),
  12.  *    @ORM\Index(name="idx_treatment", columns={"treatment_id"})
  13.  *  })
  14.  * @ORM\Entity(repositoryClass=TreatmentActivityRepository::class)
  15.  */
  16. class TreatmentActivity
  17. {
  18.     const CATEGORY_ACTIVITY 'ACTIVITY';
  19.     const CATEGORY_MED 'MED';
  20.     const CATEGORY_PICTURE 'PICTURE';
  21.     const FEEDBACK_REVIEWING 'REVIEWING';
  22.     const FEEDBACK_REVIEWED 'REVIEWED';
  23.     public static function getCategoryDefinitions(){
  24.         return [
  25.             self::CATEGORY_ACTIVITY => 'Activity',
  26.             self::CATEGORY_MED => 'Med',
  27.             self::CATEGORY_PICTURE => 'Picture',
  28.         ];
  29.     }
  30.     /**
  31.      * @ORM\Id
  32.      * @ORM\GeneratedValue
  33.      * @ORM\Column(type="integer")
  34.      */
  35.     private $id;
  36.     /**
  37.      * @ORM\ManyToOne(targetEntity="App\Entity\Treatment")
  38.      * @Serializer\Type("Relation")
  39.      */
  40.     private $treatment;
  41.     /**
  42.      * @ORM\ManyToOne(targetEntity="App\Entity\TreatmentActivity")
  43.      * @Serializer\Type("Relation")
  44.      */
  45.     private $parent;
  46.     /**
  47.      * @ORM\Column(type="integer", nullable=true)
  48.      */
  49.     private $day;
  50.     /**
  51.      * @ORM\Column(type="string", length=512)
  52.      */
  53.     private $description;
  54.     /**
  55.      * @ORM\Column(type="string", length=40, nullable=true)
  56.      */
  57.     private $category self::CATEGORY_ACTIVITY;
  58.     /**
  59.      * @ORM\Column(type="date")
  60.      */
  61.     private $date;
  62.     /**
  63.      * @ORM\Column(type="string", nullable=true)
  64.      */
  65.     private $time;
  66.     /**
  67.      * @ORM\Column(type="string", length=255, nullable=true)
  68.      */
  69.     private $link;
  70.     /**
  71.      * @ORM\ManyToOne(targetEntity="App\Entity\ContentBlock")
  72.      * @Serializer\Type("Relation")
  73.      */
  74.     private $content;
  75.     /**
  76.      * @ORM\Column(type="boolean", nullable=true)
  77.      */
  78.     private $completed false;
  79.     /**
  80.      * @ORM\OneToMany(targetEntity="App\Entity\Picture", mappedBy="treatmentActivity")
  81.      */
  82.     private $pictures;
  83.     /**
  84.      * @ORM\Column(name="feedback", type="text", nullable=true)
  85.      */
  86.     private $feedback;
  87.     /**
  88.      * @ORM\Column(name="feedback_status", type="text", nullable=true)
  89.      */
  90.     private $feedbackStatus;
  91.     /**
  92.      * @ORM\Column(name="deleted_at", type="datetime", nullable=true)
  93.      */
  94.     private $deletedAt;
  95.     /**
  96.      * @ORM\ManyToOne(targetEntity="App\Entity\Admin")
  97.      * @Serializer\Type("Relation")
  98.      */
  99.     private $createdBy;
  100.     /**
  101.      * @ORM\ManyToOne(targetEntity="App\Entity\Admin")
  102.      * @Serializer\Type("Relation")
  103.      */
  104.     private $updatedBy;
  105.     /**
  106.      * @ORM\Column(type="string", length=255, nullable=true)
  107.      */
  108.     private $notificationTitle;
  109.     /**
  110.      * @ORM\Column(type="string", length=255, nullable=true)
  111.      */
  112.     private $notificationBody;
  113.     /**
  114.      * @ORM\ManyToOne(targetEntity=Package::class)
  115.      */
  116.     private $parentPackage;
  117.     /**
  118.      * @ORM\Column(type="array", nullable=true)
  119.      */
  120.     private $repetition = [];
  121.     /**
  122.      * @ORM\Column(type="string", length=255, nullable=false)
  123.      */
  124.     private $name;
  125.     /**
  126.      * @ORM\Column(type="string", length=255, nullable=true)
  127.      */
  128.     private $identity;
  129.     use CreatedUpdatedTrait;
  130.     public function __construct(){
  131.         return $this->pictures;
  132.     }
  133.     public function getId(): ?int
  134.     {
  135.         return $this->id;
  136.     }
  137.     /**
  138.      * @return mixed
  139.      */
  140.     public function getTreatment()
  141.     {
  142.         return $this->treatment;
  143.     }
  144.     /**
  145.      * @param mixed $treatment
  146.      */
  147.     public function setTreatment($treatment): void
  148.     {
  149.         $this->treatment $treatment;
  150.     }
  151.     /**
  152.      * @return mixed
  153.      */
  154.     public function getParent()
  155.     {
  156.         return $this->parent;
  157.     }
  158.     /**
  159.      * @param mixed $parent
  160.      */
  161.     public function setParent($parent): void
  162.     {
  163.         $this->parent $parent;
  164.     }
  165.     /**
  166.      * @return mixed
  167.      */
  168.     public function getDay()
  169.     {
  170.         return $this->day;
  171.     }
  172.     /**
  173.      * @param mixed $day
  174.      */
  175.     public function setDay($day): void
  176.     {
  177.         $this->day $day;
  178.     }
  179.     public function getDescription()
  180.     {
  181.         return $this->description;
  182.     }
  183.     public function setDescription($description)
  184.     {
  185.         $this->description $description;
  186.         return $this;
  187.     }
  188.     /**
  189.      * @return mixed
  190.      */
  191.     public function getCategory()
  192.     {
  193.         return $this->category;
  194.     }
  195.     /**
  196.      * @param mixed $category
  197.      */
  198.     public function setCategory($category): void
  199.     {
  200.         $this->category $category;
  201.     }
  202.     public function getDate(): ?\DateTimeInterface
  203.     {
  204.         return $this->date;
  205.     }
  206.     public function setDate(\DateTimeInterface $date): self
  207.     {
  208.         $this->date $date;
  209.         return $this;
  210.     }
  211.     /**
  212.      * @return mixed
  213.      */
  214.     public function getTime()
  215.     {
  216.         return $this->time;
  217.     }
  218.     /**
  219.      * @param mixed $time
  220.      */
  221.     public function setTime($time): void
  222.     {
  223.         $this->time $time;
  224.     }
  225.     /**
  226.      * @return mixed
  227.      */
  228.     public function getLink()
  229.     {
  230.         return $this->link;
  231.     }
  232.     /**
  233.      * @param mixed $link
  234.      */
  235.     public function setLink($link): void
  236.     {
  237.         $this->link $link;
  238.     }
  239.     /**
  240.      * @return mixed
  241.      */
  242.     public function getContent()
  243.     {
  244.         return $this->content;
  245.     }
  246.     /**
  247.      * @param mixed $content
  248.      */
  249.     public function setContent($content): void
  250.     {
  251.         $this->content $content;
  252.     }
  253.     /**
  254.      * @return mixed
  255.      */
  256.     public function isCompleted()
  257.     {
  258.         return $this->completed;
  259.     }
  260.     /**
  261.      * @param mixed $completed
  262.      */
  263.     public function setCompleted($completed): void
  264.     {
  265.         $this->completed $completed;
  266.     }
  267.     /**
  268.      * @return mixed
  269.      */
  270.     public function getPictures()
  271.     {
  272.         return $this->pictures;
  273.     }
  274.     /**
  275.      * @return mixed
  276.      */
  277.     public function getFeedback()
  278.     {
  279.         return $this->feedback;
  280.     }
  281.     /**
  282.      * @param mixed $feedback
  283.      */
  284.     public function setFeedback($feedback): void
  285.     {
  286.         $this->feedback $feedback;
  287.     }
  288.     /**
  289.      * @return mixed
  290.      */
  291.     public function getFeedbackStatus()
  292.     {
  293.         return $this->feedbackStatus;
  294.     }
  295.     /**
  296.      * @param mixed $feedbackStatus
  297.      */
  298.     public function setFeedbackStatus($feedbackStatus): void
  299.     {
  300.         $this->feedbackStatus $feedbackStatus;
  301.     }
  302.     /**
  303.      * @param mixed $deletedAt
  304.      */
  305.     public function setDeletedAt($deletedAt): void
  306.     {
  307.         $this->deletedAt $deletedAt;
  308.     }
  309.     /**
  310.      * @return mixed
  311.      */
  312.     public function getDeletedAt()
  313.     {
  314.         return $this->deletedAt;
  315.     }
  316.     /**
  317.      * @return mixed
  318.      */
  319.     public function getCreatedBy()
  320.     {
  321.         return $this->createdBy;
  322.     }
  323.     /**
  324.      * @param mixed $createdBy
  325.      */
  326.     public function setCreatedBy($createdBy): void
  327.     {
  328.         $this->createdBy $createdBy;
  329.     }
  330.     /**
  331.      * @return mixed
  332.      */
  333.     public function getUpdatedBy()
  334.     {
  335.         return $this->updatedBy;
  336.     }
  337.     /**
  338.      * @param mixed $updatedBy
  339.      */
  340.     public function setUpdatedBy($updatedBy): void
  341.     {
  342.         $this->updatedBy $updatedBy;
  343.     }
  344.     public function getNotificationTitle(): ?string
  345.     {
  346.         return $this->notificationTitle;
  347.     }
  348.     public function setNotificationTitle(?string $notificationTitle): self
  349.     {
  350.         $this->notificationTitle $notificationTitle;
  351.         return $this;
  352.     }
  353.     /**
  354.      * @return mixed
  355.      */
  356.     public function getNotificationBody(): ?string
  357.     {
  358.         return $this->notificationBody;
  359.     }
  360.     /**
  361.      * @param mixed $notificationBody
  362.      */
  363.     public function setNotificationBody(?string $notificationBody): self
  364.     {
  365.         $this->notificationBody $notificationBody;
  366.         return $this;
  367.     }
  368.     public function getParentPackage(): ?Package
  369.     {
  370.         return $this->parentPackage;
  371.     }
  372.     public function setParentPackage(?Package $parentPackage): self
  373.     {
  374.         $this->parentPackage $parentPackage;
  375.         return $this;
  376.     }
  377.     public function getRepetition(): ?array
  378.     {
  379.         return $this->repetition;
  380.     }
  381.     public function setRepetition(?array $repetition): self
  382.     {
  383.         $this->repetition $repetition;
  384.         return $this;
  385.     }
  386.     public function getName(): ?string
  387.     {
  388.         return $this->name;
  389.     }
  390.     public function setName(?string $name): self
  391.     {
  392.         $this->name $name;
  393.         return $this;
  394.     }
  395.     public function getIdentity(): ?string
  396.     {
  397.         return $this->identity;
  398.     }
  399.     public function setIdentity(?string $identity): self
  400.     {
  401.         $this->identity $identity;
  402.         return $this;
  403.     }
  404. }