uuid = Uuid::v4(); $this->assignment = $assignment; $this->teamer = $teamer; $this->status = static::STATUS_NEW; } public function getId(): ?int { return $this->id; } public function getUuid(): string { return $this->uuid; } public function getAssignment(): ?Assignment { return $this->assignment; } public function setAssignment(?Assignment $assignment): static { $this->assignment = $assignment; return $this; } public function getTeamer(): ?Teamer { return $this->teamer; } public function setTeamer(?Teamer $teamer): static { $this->teamer = $teamer; return $this; } public function getRequests(): ?string { return $this->requests; } public function setRequests(?string $requests): static { $this->requests = $requests; return $this; } public function getStatus(): ?string { return $this->status; } public function setStatus(string $status): static { $this->status = $status; return $this; } public function matchesPickup(): bool { if (0 === $pickupId = (int) $this->getAssignment()->getPickup()) { return true; } $teamer = $this->getTeamer(); return $teamer->hasPickup($pickupId); } public function matchesRequiredTrainings(): bool { $count = 0; $requiredTrainings = $this->getAssignment()->getJobProfile()->getRequiredTrainings(); $teamer = $this->getTeamer(); foreach ($requiredTrainings as $requiredTraining) { if ($teamer->getTrainingAttendance($requiredTraining)) { ++$count; } } return $count === $requiredTrainings->count(); } public function getComment(): ?string { return $this->comment; } public function setComment(?string $comment): static { $this->comment = $comment; return $this; } public function isCommentVisible(): ?bool { return $this->commentVisible; } public function setCommentVisible(bool $commentVisible): static { $this->commentVisible = $commentVisible; return $this; } }