<?php
namespace App\Entity;
use App\Repository\TreatmentActivityRepository;
use App\Traits\CreatedUpdatedTrait;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation as Serializer;
/**
* @ORM\Table(name="v_treatment_activity",
* indexes={
* @ORM\Index(name="idx_description", columns={"description"}),
* @ORM\Index(name="idx_name", columns={"name"}),
* @ORM\Index(name="idx_treatment", columns={"treatment_id"})
* })
* @ORM\Entity(repositoryClass=TreatmentActivityRepository::class)
*/
class TreatmentActivity
{
const CATEGORY_ACTIVITY = 'ACTIVITY';
const CATEGORY_MED = 'MED';
const CATEGORY_PICTURE = 'PICTURE';
const FEEDBACK_REVIEWING = 'REVIEWING';
const FEEDBACK_REVIEWED = 'REVIEWED';
public static function getCategoryDefinitions(){
return [
self::CATEGORY_ACTIVITY => 'Activity',
self::CATEGORY_MED => 'Med',
self::CATEGORY_PICTURE => 'Picture',
];
}
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Treatment")
* @Serializer\Type("Relation")
*/
private $treatment;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\TreatmentActivity")
* @Serializer\Type("Relation")
*/
private $parent;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $day;
/**
* @ORM\Column(type="string", length=512)
*/
private $description;
/**
* @ORM\Column(type="string", length=40, nullable=true)
*/
private $category = self::CATEGORY_ACTIVITY;
/**
* @ORM\Column(type="date")
*/
private $date;
/**
* @ORM\Column(type="string", nullable=true)
*/
private $time;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $link;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\ContentBlock")
* @Serializer\Type("Relation")
*/
private $content;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $completed = false;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Picture", mappedBy="treatmentActivity")
*/
private $pictures;
/**
* @ORM\Column(name="feedback", type="text", nullable=true)
*/
private $feedback;
/**
* @ORM\Column(name="feedback_status", type="text", nullable=true)
*/
private $feedbackStatus;
/**
* @ORM\Column(name="deleted_at", type="datetime", nullable=true)
*/
private $deletedAt;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Admin")
* @Serializer\Type("Relation")
*/
private $createdBy;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Admin")
* @Serializer\Type("Relation")
*/
private $updatedBy;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $notificationTitle;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $notificationBody;
/**
* @ORM\ManyToOne(targetEntity=Package::class)
*/
private $parentPackage;
/**
* @ORM\Column(type="array", nullable=true)
*/
private $repetition = [];
/**
* @ORM\Column(type="string", length=255, nullable=false)
*/
private $name;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $identity;
use CreatedUpdatedTrait;
public function __construct(){
return $this->pictures;
}
public function getId(): ?int
{
return $this->id;
}
/**
* @return mixed
*/
public function getTreatment()
{
return $this->treatment;
}
/**
* @param mixed $treatment
*/
public function setTreatment($treatment): void
{
$this->treatment = $treatment;
}
/**
* @return mixed
*/
public function getParent()
{
return $this->parent;
}
/**
* @param mixed $parent
*/
public function setParent($parent): void
{
$this->parent = $parent;
}
/**
* @return mixed
*/
public function getDay()
{
return $this->day;
}
/**
* @param mixed $day
*/
public function setDay($day): void
{
$this->day = $day;
}
public function getDescription()
{
return $this->description;
}
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
* @return mixed
*/
public function getCategory()
{
return $this->category;
}
/**
* @param mixed $category
*/
public function setCategory($category): void
{
$this->category = $category;
}
public function getDate(): ?\DateTimeInterface
{
return $this->date;
}
public function setDate(\DateTimeInterface $date): self
{
$this->date = $date;
return $this;
}
/**
* @return mixed
*/
public function getTime()
{
return $this->time;
}
/**
* @param mixed $time
*/
public function setTime($time): void
{
$this->time = $time;
}
/**
* @return mixed
*/
public function getLink()
{
return $this->link;
}
/**
* @param mixed $link
*/
public function setLink($link): void
{
$this->link = $link;
}
/**
* @return mixed
*/
public function getContent()
{
return $this->content;
}
/**
* @param mixed $content
*/
public function setContent($content): void
{
$this->content = $content;
}
/**
* @return mixed
*/
public function isCompleted()
{
return $this->completed;
}
/**
* @param mixed $completed
*/
public function setCompleted($completed): void
{
$this->completed = $completed;
}
/**
* @return mixed
*/
public function getPictures()
{
return $this->pictures;
}
/**
* @return mixed
*/
public function getFeedback()
{
return $this->feedback;
}
/**
* @param mixed $feedback
*/
public function setFeedback($feedback): void
{
$this->feedback = $feedback;
}
/**
* @return mixed
*/
public function getFeedbackStatus()
{
return $this->feedbackStatus;
}
/**
* @param mixed $feedbackStatus
*/
public function setFeedbackStatus($feedbackStatus): void
{
$this->feedbackStatus = $feedbackStatus;
}
/**
* @param mixed $deletedAt
*/
public function setDeletedAt($deletedAt): void
{
$this->deletedAt = $deletedAt;
}
/**
* @return mixed
*/
public function getDeletedAt()
{
return $this->deletedAt;
}
/**
* @return mixed
*/
public function getCreatedBy()
{
return $this->createdBy;
}
/**
* @param mixed $createdBy
*/
public function setCreatedBy($createdBy): void
{
$this->createdBy = $createdBy;
}
/**
* @return mixed
*/
public function getUpdatedBy()
{
return $this->updatedBy;
}
/**
* @param mixed $updatedBy
*/
public function setUpdatedBy($updatedBy): void
{
$this->updatedBy = $updatedBy;
}
public function getNotificationTitle(): ?string
{
return $this->notificationTitle;
}
public function setNotificationTitle(?string $notificationTitle): self
{
$this->notificationTitle = $notificationTitle;
return $this;
}
/**
* @return mixed
*/
public function getNotificationBody(): ?string
{
return $this->notificationBody;
}
/**
* @param mixed $notificationBody
*/
public function setNotificationBody(?string $notificationBody): self
{
$this->notificationBody = $notificationBody;
return $this;
}
public function getParentPackage(): ?Package
{
return $this->parentPackage;
}
public function setParentPackage(?Package $parentPackage): self
{
$this->parentPackage = $parentPackage;
return $this;
}
public function getRepetition(): ?array
{
return $this->repetition;
}
public function setRepetition(?array $repetition): self
{
$this->repetition = $repetition;
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(?string $name): self
{
$this->name = $name;
return $this;
}
public function getIdentity(): ?string
{
return $this->identity;
}
public function setIdentity(?string $identity): self
{
$this->identity = $identity;
return $this;
}
}