src/Entity/ProjectActivity.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProjectActivityRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=ProjectActivityRepository::class)
  9.  */
  10. class ProjectActivity
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $title;
  22.     /**
  23.      * @ORM\Column(type="text", nullable=true)
  24.      */
  25.     private $description;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity=ProjectMilestone::class, inversedBy="projectActivities")
  28.      * @ORM\JoinColumn(nullable=false)
  29.      */
  30.     private $milestone;
  31.     /**
  32.      * @ORM\Column(type="integer")
  33.      */
  34.     private $status;
  35.     /**
  36.      * @ORM\Column(type="integer")
  37.      */
  38.     private $display_order;
  39.     /**
  40.      * @ORM\Column(type="boolean")
  41.      */
  42.     private $is_active;
  43.     /**
  44.      * @ORM\Column(type="float", nullable=true)
  45.      */
  46.     private $weight;
  47.     /**
  48.      * @ORM\ManyToOne(targetEntity=User::class)
  49.      * @ORM\JoinColumn(nullable=false)
  50.      */
  51.     private $created_by;
  52.     /**
  53.      * @ORM\Column(type="datetime")
  54.      */
  55.     private $created_at;
  56.     /**
  57.      * @ORM\OneToMany(targetEntity=ActivityFiles::class, mappedBy="activity")
  58.      */
  59.     private $activityFiles;
  60.     /**
  61.      * @ORM\OneToMany(targetEntity=ActivityUser::class, mappedBy="activity")
  62.      */
  63.     private $activityUsers;
  64.     /**
  65.      * @ORM\OneToMany(targetEntity=ActivityProgress::class, mappedBy="activity")
  66.      */
  67.     private $activityProgress;
  68.     /**
  69.      * @ORM\OneToMany(targetEntity=ActivityChat::class, mappedBy="activity")
  70.      */
  71.     private $activityChats;
  72.     /**
  73.      * @ORM\ManyToOne(targetEntity=Project::class, inversedBy="projectActivities")
  74.      * @ORM\JoinColumn(nullable=false)
  75.      */
  76.     private $project;
  77.     /**
  78.      * @ORM\ManyToOne(targetEntity=ProjectActivity::class)
  79.      */
  80.     private $parent;
  81.     /**
  82.      * @ORM\Column(type="date")
  83.      */
  84.     private $start_date;
  85.     /**
  86.      * @ORM\Column(type="date")
  87.      */
  88.     private $end_date;
  89.     /**
  90.      * @ORM\Column(type="datetime", nullable=true)
  91.      */
  92.     private $submittedAt;
  93.     public function __construct()
  94.     {
  95.         $this->activityFiles = new ArrayCollection();
  96.         $this->activityUsers = new ArrayCollection();
  97.         $this->activityProgress = new ArrayCollection();
  98.         $this->activityChats = new ArrayCollection();
  99.     }
  100.     public function getId(): ?int
  101.     {
  102.         return $this->id;
  103.     }
  104.     public function getTitle(): ?string
  105.     {
  106.         return $this->title;
  107.     }
  108.     public function setTitle(string $title): self
  109.     {
  110.         $this->title $title;
  111.         return $this;
  112.     }
  113.     public function getDescription(): ?string
  114.     {
  115.         return $this->description;
  116.     }
  117.     public function setDescription(?string $description): self
  118.     {
  119.         $this->description $description;
  120.         return $this;
  121.     }
  122.     public function getMilestone(): ?ProjectMilestone
  123.     {
  124.         return $this->milestone;
  125.     }
  126.     public function setMilestone(?ProjectMilestone $milestone): self
  127.     {
  128.         $this->milestone $milestone;
  129.         return $this;
  130.     }
  131.     public function getStatus(): ?int
  132.     {
  133.         return $this->status;
  134.     }
  135.     public function setStatus(int $status): self
  136.     {
  137.         $this->status $status;
  138.         return $this;
  139.     }
  140.     public function getDisplayOrder(): ?int
  141.     {
  142.         return $this->display_order;
  143.     }
  144.     public function setDisplayOrder(int $display_order): self
  145.     {
  146.         $this->display_order $display_order;
  147.         return $this;
  148.     }
  149.     public function getIsActive(): ?bool
  150.     {
  151.         return $this->is_active;
  152.     }
  153.     public function setIsActive(bool $is_active): self
  154.     {
  155.         $this->is_active $is_active;
  156.         return $this;
  157.     }
  158.     public function getWeight(): ?float
  159.     {
  160.         return $this->weight;
  161.     }
  162.     public function setWeight(?float $weight): self
  163.     {
  164.         $this->weight $weight;
  165.         return $this;
  166.     }
  167.     public function getCreatedBy(): ?User
  168.     {
  169.         return $this->created_by;
  170.     }
  171.     public function setCreatedBy(?User $created_by): self
  172.     {
  173.         $this->created_by $created_by;
  174.         return $this;
  175.     }
  176.     public function getCreatedAt(): ?\DateTimeInterface
  177.     {
  178.         return $this->created_at;
  179.     }
  180.     public function setCreatedAt(\DateTimeInterface $created_at): self
  181.     {
  182.         $this->created_at $created_at;
  183.         return $this;
  184.     }
  185.     /**
  186.      * @return Collection|ActivityFiles[]
  187.      */
  188.     public function getActivityFiles(): Collection
  189.     {
  190.         return $this->activityFiles;
  191.     }
  192.     public function addActivityFile(ActivityFiles $activityFile): self
  193.     {
  194.         if (!$this->activityFiles->contains($activityFile)) {
  195.             $this->activityFiles[] = $activityFile;
  196.             $activityFile->setActivity($this);
  197.         }
  198.         return $this;
  199.     }
  200.     public function removeActivityFile(ActivityFiles $activityFile): self
  201.     {
  202.         if ($this->activityFiles->removeElement($activityFile)) {
  203.             // set the owning side to null (unless already changed)
  204.             if ($activityFile->getActivity() === $this) {
  205.                 $activityFile->setActivity(null);
  206.             }
  207.         }
  208.         return $this;
  209.     }
  210.     /**
  211.      * @return Collection|ActivityUser[]
  212.      */
  213.     public function getActivityUsers(): Collection
  214.     {
  215.         return $this->activityUsers;
  216.     }
  217.     public function addActivityUser(ActivityUser $activityUser): self
  218.     {
  219.         if (!$this->activityUsers->contains($activityUser)) {
  220.             $this->activityUsers[] = $activityUser;
  221.             $activityUser->setActivity($this);
  222.         }
  223.         return $this;
  224.     }
  225.     public function removeActivityUser(ActivityUser $activityUser): self
  226.     {
  227.         if ($this->activityUsers->removeElement($activityUser)) {
  228.             // set the owning side to null (unless already changed)
  229.             if ($activityUser->getActivity() === $this) {
  230.                 $activityUser->setActivity(null);
  231.             }
  232.         }
  233.         return $this;
  234.     }
  235.     /**
  236.      * @return Collection|ActivityProgress[]
  237.      */
  238.     public function getActivityProgress(): Collection
  239.     {
  240.         return $this->activityProgress;
  241.     }
  242.     public function addActivityProgress(ActivityProgress $activityProgress): self
  243.     {
  244.         if (!$this->activityProgress->contains($activityProgress)) {
  245.             $this->activityProgress[] = $activityProgress;
  246.             $activityProgress->setActivity($this);
  247.         }
  248.         return $this;
  249.     }
  250.     public function removeActivityProgress(ActivityProgress $activityProgress): self
  251.     {
  252.         if ($this->activityProgress->removeElement($activityProgress)) {
  253.             // set the owning side to null (unless already changed)
  254.             if ($activityProgress->getActivity() === $this) {
  255.                 $activityProgress->setActivity(null);
  256.             }
  257.         }
  258.         return $this;
  259.     }
  260.     /**
  261.      * @return Collection|ActivityChat[]
  262.      */
  263.     public function getActivityChats(): Collection
  264.     {
  265.         return $this->activityChats;
  266.     }
  267.     public function addActivityChat(ActivityChat $activityChat): self
  268.     {
  269.         if (!$this->activityChats->contains($activityChat)) {
  270.             $this->activityChats[] = $activityChat;
  271.             $activityChat->setActivity($this);
  272.         }
  273.         return $this;
  274.     }
  275.     public function removeActivityChat(ActivityChat $activityChat): self
  276.     {
  277.         if ($this->activityChats->removeElement($activityChat)) {
  278.             // set the owning side to null (unless already changed)
  279.             if ($activityChat->getActivity() === $this) {
  280.                 $activityChat->setActivity(null);
  281.             }
  282.         }
  283.         return $this;
  284.     }
  285.     public function getProject(): ?Project
  286.     {
  287.         return $this->project;
  288.     }
  289.     public function setProject(?Project $project): self
  290.     {
  291.         $this->project $project;
  292.         return $this;
  293.     }
  294.     public function getParent(): ?self
  295.     {
  296.         return $this->parent;
  297.     }
  298.     public function setParent(?self $parent): self
  299.     {
  300.         $this->parent $parent;
  301.         return $this;
  302.     }
  303.     public function __toString()
  304.     {
  305.         return $this->display_order.' '.$this->title;
  306.     }
  307.     public function getStartDate(): ?\DateTimeInterface
  308.     {
  309.         return $this->start_date;
  310.     }
  311.     public function setStartDate(\DateTimeInterface $start_date): self
  312.     {
  313.         $this->start_date $start_date;
  314.         return $this;
  315.     }
  316.     public function getEndDate(): ?\DateTimeInterface
  317.     {
  318.         return $this->end_date;
  319.     }
  320.     public function setEndDate(\DateTimeInterface $end_date): self
  321.     {
  322.         $this->end_date $end_date;
  323.         return $this;
  324.     }
  325.     public function getSubmittedAt(): ?\DateTimeInterface
  326.     {
  327.         return $this->submittedAt;
  328.     }
  329.     public function setSubmittedAt(?\DateTimeInterface $submittedAt): self
  330.     {
  331.         $this->submittedAt $submittedAt;
  332.         return $this;
  333.     }
  334. }