src/Entity/Purpose.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PurposeRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClass: PurposeRepository::class)]
  9. class Purpose
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id = null;
  15.     #[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
  16.     private ?\DateTimeInterface $CreatedAt = null;
  17.     #[ORM\ManyToOne]
  18.     private ?User $CreatedBy = null;
  19.     #[ORM\Column(type: Types::TEXT, nullable: true)]
  20.     private ?string $Content = null;
  21.     #[ORM\ManyToOne]
  22.     private ?LawOffice $LawOffice = null;
  23.     #[ORM\Column(nullable: true)]
  24.     private ?bool $IsJudgement = null;
  25.     #[ORM\OneToMany(mappedBy: 'Purpose', targetEntity: TheCaseActions::class)]
  26.     private Collection $theCaseActions;
  27.     public function __construct()
  28.     {
  29.         $this->theCaseActions = new ArrayCollection();
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getCreatedAt(): ?\DateTimeInterface
  36.     {
  37.         return $this->CreatedAt;
  38.     }
  39.     public function setCreatedAt(?\DateTimeInterface $CreatedAt): self
  40.     {
  41.         $this->CreatedAt = $CreatedAt;
  42.         return $this;
  43.     }
  44.     public function getCreatedBy(): ?User
  45.     {
  46.         return $this->CreatedBy;
  47.     }
  48.     public function setCreatedBy(?User $CreatedBy): self
  49.     {
  50.         $this->CreatedBy = $CreatedBy;
  51.         return $this;
  52.     }
  53.     public function getContent(): ?string
  54.     {
  55.         return $this->Content;
  56.     }
  57.     public function setContent(?string $Content): self
  58.     {
  59.         $this->Content = $Content;
  60.         return $this;
  61.     }
  62.     public function getLawOffice(): ?LawOffice
  63.     {
  64.         return $this->LawOffice;
  65.     }
  66.     public function setLawOffice(?LawOffice $LawOffice): self
  67.     {
  68.         $this->LawOffice = $LawOffice;
  69.         return $this;
  70.     }
  71.     public function isIsJudgement(): ?bool
  72.     {
  73.         return $this->IsJudgement;
  74.     }
  75.     public function setIsJudgement(?bool $IsJudgement): self
  76.     {
  77.         $this->IsJudgement = $IsJudgement;
  78.         return $this;
  79.     }
  80.     /**
  81.      * @return Collection<int, TheCaseActions>
  82.      */
  83.     public function getTheCaseActions(): Collection
  84.     {
  85.         return $this->theCaseActions;
  86.     }
  87.     public function addTheCaseAction(TheCaseActions $theCaseAction): self
  88.     {
  89.         if (!$this->theCaseActions->contains($theCaseAction)) {
  90.             $this->theCaseActions->add($theCaseAction);
  91.             $theCaseAction->setPurpose($this);
  92.         }
  93.         return $this;
  94.     }
  95.     public function removeTheCaseAction(TheCaseActions $theCaseAction): self
  96.     {
  97.         if ($this->theCaseActions->removeElement($theCaseAction)) {
  98.             // set the owning side to null (unless already changed)
  99.             if ($theCaseAction->getPurpose() === $this) {
  100.                 $theCaseAction->setPurpose(null);
  101.             }
  102.         }
  103.         return $this;
  104.     }
  105. }