*/ #[ORM\OneToMany(targetEntity: Comment::class, mappedBy: 'task', orphanRemoval: true)] private Collection $comments; #[ORM\Column(type: Types::TEXT, nullable: true)] private ?string $description = null; #[ORM\ManyToOne(inversedBy: 'tasks')] #[ORM\JoinColumn(nullable: false)] private ?User $createdBy = null; #[ORM\Column] #[Gedmo\Timestampable(on: 'create')] private ?\DateTimeImmutable $createdAt = null; #[ORM\ManyToOne] private ?User $lockedBy = null; #[ORM\Column(nullable: true)] private ?\DateTimeImmutable $lockedAt = null; #[ORM\Column(nullable: true)] private ?\DateTimeImmutable $startAt = null; #[ORM\Column(nullable: true)] private ?\DateTimeImmutable $finishAt = null; #[ORM\ManyToOne] private ?User $doneBy = null; #[ORM\Column(type: Types::TEXT, nullable: true)] private ?string $changesets_result = null; public function __construct() { $this->comments = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): static { $this->name = $name; return $this; } public function getSlug(): ?string { return $this->slug; } public function getUrgent(): ?int { return $this->urgent; } public function setUrgent(?int $urgent): static { $this->urgent = $urgent; return $this; } public function getImportant(): ?int { return $this->important; } public function setImportant(?int $important): static { $this->important = $important; return $this; } public function getStatus(): ?string { return $this->status; } public function setStatus($status, array $context = []): static { $this->status = $status; return $this; } public function getProject(): ?Project { return $this->project; } public function setProject(?Project $project): static { $this->project = $project; return $this; } public function hasGeojson(): bool { return isset($this->geojson); } public function getGeojson(): ?string { return $this->geojson; } public function setGeojson(string $geojson): static { $this->geojson = $geojson; return $this; } public function getOsm(): ?string { return $this->osm; } public function setOsm(string $osm): static { $this->osm = $osm; return $this; } /** * @return Collection */ public function getComments(): Collection { return $this->comments; } public function addComment(Comment $comment): static { if (!$this->comments->contains($comment)) { $this->comments->add($comment); $comment->setTask($this); } return $this; } public function removeComment(Comment $comment): static { if ($this->comments->removeElement($comment)) { // set the owning side to null (unless already changed) if ($comment->getTask() === $this) { $comment->setTask(null); } } return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): static { $this->description = $description; return $this; } public function getCreatedBy(): ?User { return $this->createdBy; } public function setCreatedBy(?User $createdBy): static { $this->createdBy = $createdBy; return $this; } public function getCreatedAt(): ?\DateTimeImmutable { return $this->createdAt; } public function setCreatedAt(\DateTimeImmutable $createdAt): static { $this->createdAt = $createdAt; return $this; } public function getLockedBy(): ?User { return $this->lockedBy; } public function setLockedBy(?User $lockedBy): static { $this->lockedBy = $lockedBy; return $this; } public function getLockedAt(): ?\DateTimeImmutable { return $this->lockedAt; } public function setLockedAt(?\DateTimeImmutable $lockedAt): static { $this->lockedAt = $lockedAt; return $this; } public function isLocked(): bool { return !is_null($this->lockedBy); } public function lock(User $user): static { $this->setLockedBy($user); $this->setLockedAt(new \DateTimeImmutable('now')); return $this; } public function unlock(): static { $this->setLockedBy(null); $this->setLockedAt(null); return $this; } public function getStartAt(): ?\DateTimeImmutable { return $this->startAt; } public function setStartAt(?\DateTimeImmutable $startAt): static { $this->startAt = $startAt; return $this; } public function getFinishAt(): ?\DateTimeImmutable { return $this->finishAt; } public function setFinishAt(?\DateTimeImmutable $finishAt): static { $this->finishAt = $finishAt; return $this; } public function getDoneBy(): ?User { return $this->doneBy; } public function setDoneBy(?User $doneBy): static { $this->doneBy = $doneBy; return $this; } public function getChangesetsResult(): ?string { return $this->changesets_result; } public function setChangesetsResult(?string $changesets_result): static { $this->changesets_result = $changesets_result; return $this; } }