attachments = new ArrayCollection(); $this->snapshots = new ArrayCollection(); $this->comments = new ArrayCollection(); } /** * @return int */ public function getId(): int { return $this->id; } /** * @param int $id * @return Fault */ public function setId(int $id): Fault { $this->id = $id; return $this; } /** * @return string */ public function getWorksheetNumber(): ?string { return $this->worksheetNumber; } /** * @param string $worksheetNumber * @return Fault */ public function setWorksheetNumber(?string $worksheetNumber): Fault { $this->worksheetNumber = $worksheetNumber; return $this; } /** * @return string */ public function getFaultType(): ?string { return $this->faultType; } /** * @param string $faultType * @return Fault */ public function setFaultType(?string $faultType): Fault { $this->faultType = $faultType; return $this; } /** * @return FacilityLocation */ public function getFacilityLocation(): FacilityLocation { return $this->facilityLocation; } /** * @param FacilityLocation $facilityLocation * @return Fault */ public function setFacilityLocation(FacilityLocation $facilityLocation): Fault { $this->facilityLocation = $facilityLocation; return $this; } /** * @return string */ public function getFacilityLocationDescription() { return $this->facilityLocationDescription; } /** * @param string $facilityLocationDescription * @return Fault */ public function setFacilityLocationDescription(string $facilityLocationDescription): Fault { $this->facilityLocationDescription = $facilityLocationDescription; return $this; } /** * @return ErrorCategory */ public function getErrorCategory(): ErrorCategory { return $this->errorCategory; } /** * @param ErrorCategory $errorCategory * @return Fault */ public function setErrorCategory(ErrorCategory $errorCategory): Fault { $this->errorCategory = $errorCategory; return $this; } /** * @return ErrorOrigin */ public function getErrorOrigin(): ErrorOrigin { return $this->errorOrigin; } /** * @param ErrorOrigin $errorOrigin * @return Fault */ public function setErrorOrigin(ErrorOrigin $errorOrigin): Fault { $this->errorOrigin = $errorOrigin; return $this; } /** * @return string */ public function getErrorDescription() { return $this->errorDescription; } /** * @param string $errorDescription * @return Fault */ public function setErrorDescription(string $errorDescription): Fault { $this->errorDescription = $errorDescription; return $this; } /** * @return SolutionTimeInterval */ public function getSolutionTimeInterval(): SolutionTimeInterval { return $this->solutionTimeInterval; } /** * @param SolutionTimeInterval $solutionTimeInterval * @return Fault */ public function setSolutionTimeInterval(SolutionTimeInterval $solutionTimeInterval): Fault { $this->solutionTimeInterval = $solutionTimeInterval; return $this; } /** * @return string */ public function getSolutionTimeIntervalOther() { return $this->solutionTimeIntervalOther; } /** * @param string $solutionTimeIntervalOther * @return Fault */ public function setSolutionTimeIntervalOther(string $solutionTimeIntervalOther): Fault { $this->solutionTimeIntervalOther = $solutionTimeIntervalOther; return $this; } /** * @return string */ public function getState(): string { return $this->state; } /** * @param string $state * @return Fault */ public function setState(string $state): Fault { $this->state = $state; return $this; } /** * @return ArrayCollection */ public function getAttachments() { return $this->attachments; } /** * @param Attachment $attachment * @return Fault */ public function addAttachment(Attachment $attachment): Fault { $this->attachments->add($attachment); $attachment->setFault($this); return $this; } public function addAttachments(Collection $attachments): Fault { foreach ($attachments as $attachment) { $this->addAttachment($attachment); } return $this; } /** * @param Attachment $attachment * @return Fault */ public function removeAttachment(Attachment $attachment): Fault { $this->attachments->removeElement($attachment); return $this; } public function removeAttachments(Collection $attachments): Fault { foreach ($attachments as $attachment) { $this->removeAttachment($attachment); } return $this; } /** * @return User */ public function getReporter() { return $this->reporter; } /** * @param User $reporter * @return Fault */ public function setReporter(User $reporter) { $this->reporter = $reporter; return $this; } /** * @return User */ public function getWorker() { return $this->worker; } /** * @param User $worker * @return Fault */ public function setWorker($worker) { $this->worker = $worker; return $this; } /** * @return User */ public function getConfirmer(): ?User { return $this->confirmer; } /** * @param User $confirmer * @return Fault */ public function setConfirmer(?User $confirmer): Fault { $this->confirmer = $confirmer; return $this; } /** * @return \DateTime */ public function getConfirmedAt(): ?\DateTime { return $this->confirmedAt; } /** * @param \DateTime $confirmedAt * @return Fault */ public function setConfirmedAt(?\DateTime $confirmedAt): Fault { $this->confirmedAt = $confirmedAt; return $this; } /** * @return User */ public function getAcknowledgedBy(): ?User { return $this->acknowledgedBy; } /** * @param User $acknowledgedBy * @return Fault */ public function setAcknowledgedBy(?User $acknowledgedBy): Fault { $this->acknowledgedBy = $acknowledgedBy; return $this; } /** * @return \DateTime */ public function getAcknowledgedAt(): ?\DateTime { return $this->acknowledgedAt; } /** * @param \DateTime $acknowledgedAt * @return Fault */ public function setAcknowledgedAt(?\DateTime $acknowledgedAt): Fault { $this->acknowledgedAt = $acknowledgedAt; return $this; } /** * @return User */ public function getApprovedBy(): ?User { return $this->approvedBy; } /** * @param User $approvedBy * @return Fault */ public function setApprovedBy(?User $approvedBy): Fault { $this->approvedBy = $approvedBy; return $this; } /** * @return \DateTime */ public function getApprovedAt(): ?\DateTime { return $this->approvedAt; } /** * @param \DateTime $approvedAt * @return Fault */ public function setApprovedAt(?\DateTime $approvedAt): Fault { $this->approvedAt = $approvedAt; return $this; } /** * @return \DateTime */ public function getReportAccepted(): ?\DateTime { return $this->reportAccepted; } /** * @param \DateTime $reportAccepted * @return Fault */ public function setReportAccepted(?\DateTime $reportAccepted): Fault { $this->reportAccepted = $reportAccepted; return $this; } /** * @return \DateTime */ public function getWorkStarted() { return $this->workStarted; } /** * @param \DateTime $workStarted * @return Fault */ public function setWorkStarted(\DateTime $workStarted): Fault { $this->workStarted = $workStarted; return $this; } /** * @return \DateTime */ public function getWorkFinished() { return $this->workFinished; } /** * @param \DateTime $workFinished * @return Fault */ public function setWorkFinished(\DateTime $workFinished): Fault { $this->workFinished = $workFinished; return $this; } /** * @return float */ public function getTimeSpent(): ?float { return $this->timeSpent; } /** * @param float $timeSpent * @return Fault */ public function setTimeSpent(?float $timeSpent): Fault { $this->timeSpent = $timeSpent; return $this; } /** * @return int */ public function getWorkCostEstimate(): ?int { return $this->workCostEstimate; } /** * @param int $workCostEstimate * @return Fault */ public function setWorkCostEstimate(?int $workCostEstimate): Fault { $this->workCostEstimate = $workCostEstimate; return $this; } /** * @return int */ public function getMaterialCostEstimate(): ?int { return $this->materialCostEstimate; } /** * @param int $materialCostEstimate * @return Fault */ public function setMaterialCostEstimate(?int $materialCostEstimate): Fault { $this->materialCostEstimate = $materialCostEstimate; return $this; } /** * @return mixed */ public function getUsedMaterials() { return $this->usedMaterials; } /** * @param mixed $usedMaterials * @return Fault */ public function setUsedMaterials($usedMaterials) { $this->usedMaterials = $usedMaterials; return $this; } /** * @return mixed */ public function getWorkDone() { return $this->workDone; } /** * @param mixed $workDone * @return Fault */ public function setWorkDone($workDone) { $this->workDone = $workDone; return $this; } /** * @return \DateTime */ public function getCreatedAt() { return $this->createdAt; } /** * @param \DateTime $createdAt * @return Fault */ public function setCreatedAt(\DateTime $createdAt): Fault { $this->createdAt = $createdAt; return $this; } /** * @return ArrayCollection */ public function getSnapshots() { return $this->snapshots; } /** * @return ArrayCollection */ public function getComments() { return $this->comments; } /** * @param FaultComment $comment * @return Fault */ public function addComment(FaultComment $comment): Fault { if (!$this->comments->contains($comment)) { $this->comments->add($comment); $comment->setFault($this); } return $this; } public function addComments(Collection $comments): Fault { foreach ($comments as $comment) { $this->addComment($comment); } return $this; } /** * @param FaultComment $comment * @return Fault */ public function removeComment(FaultComment $comment): Fault { if ($this->comments->contains($comment)) { $this->comments->removeElement($comment); } return $this; } public function removeComments(Collection $comments): Fault { foreach ($comments as $comment) { $this->removeComment($comment); } return $this; } /** * @return bool */ public function isMustLowerCost(): ?bool { return $this->mustLowerCost; } /** * @param bool $mustLowerCost * @return Fault */ public function setMustLowerCost(?bool $mustLowerCost): Fault { $this->mustLowerCost = $mustLowerCost; return $this; } /** * @return int */ public function getAllocatedExpense(): ?int { return $this->allocatedExpense; } /** * @param int $allocatedExpense * @return Fault */ public function setAllocatedExpense(?int $allocatedExpense): Fault { $this->allocatedExpense = $allocatedExpense; return $this; } /** * @return array */ public function jsonSerialize() { return [ 'id' => $this->id, 'faultType' => $this->getFaultType(), 'facilityLocation' => $this->getFacilityLocation(), 'facilityLocationDescription' => $this->getFacilityLocationDescription(), 'errorCategory' => $this->getErrorCategory(), 'errorOrigin' => $this->getErrorOrigin(), 'errorDescription' => $this->getErrorDescription(), 'solutionTimeInterval' => $this->getSolutionTimeInterval(), 'solutionTimeIntervalOther' => $this->getSolutionTimeIntervalOther(), 'state' => $this->getState(), 'attachments' => $this->getAttachments()->getValues() ?? [], 'worker' => $this->getWorker(), 'confirmer' => $this->getConfirmer(), 'confirmedAt' => $this->getConfirmedAt(), 'acknowledgedBy' => $this->getAcknowledgedBy(), 'acknowledgedAt' => $this->getAcknowledgedAt(), 'approvedBy' => $this->getApprovedBy(), 'approvedAt' => $this->getApprovedAt(), 'reportAccepted' => $this->getReportAccepted(), 'workStarted' => $this->getWorkStarted(), 'workFinished' => $this->getWorkFinished(), 'worksheetNumber' => $this->getWorksheetNumber(), 'timeSpent' => $this->getTimeSpent(), 'workCostEstimate' => $this->getWorkCostEstimate(), 'materialCostEstimate' => $this->getMaterialCostEstimate(), 'usedMaterials' => $this->getUsedMaterials() ?? [], 'workDone' => $this->getWorkDone() ?? [], 'createdAt' => $this->getCreatedAt(), 'faultSnapshots' => $this->getSnapshots()->toArray() ?? [], 'comments' => $this->getComments()->toArray() ?? [], 'mustLowerCost' => $this->isMustLowerCost(), 'allocatedExpense' => $this->getAllocatedExpense(), ]; } public function getFlatValues() { return [ 'id' => $this->id, 'faultType' => $this->getFaultType(), 'facilityLocation' => $this->getFacilityLocation()->getId(), 'facilityLocationDescription' => $this->getFacilityLocationDescription(), 'errorCategory' => $this->getErrorCategory()->getId(), 'errorOrigin' => $this->getErrorOrigin()->getId(), 'errorDescription' => $this->getErrorDescription(), 'solutionTimeInterval' => $this->getSolutionTimeInterval()->getId(), 'solutionTimeIntervalOther' => $this->getSolutionTimeIntervalOther(), 'state' => $this->getState(), 'attachments' => $this->getAttachments()->getValues() ?? [], 'worker' => $this->getWorker() ? $this->getWorker()->getId() : null, 'confirmer' => $this->getConfirmer() ? $this->getConfirmer()->getId() : null, 'confirmedAt' => $this->getConfirmedAt(), 'acknowledgedBy' => $this->getAcknowledgedBy() ? $this->getAcknowledgedBy()->getId() : null, 'acknowledgedAt' => $this->getAcknowledgedAt(), 'approvedBy' => $this->getApprovedBy() ? $this->getApprovedBy()->getId() : null, 'approvedAt' => $this->getApprovedAt(), 'reportAccepted' => $this->getReportAccepted(), 'workStarted' => $this->getWorkStarted(), 'workFinished' => $this->getWorkFinished(), 'worksheetNumber' => $this->getWorksheetNumber(), 'timeSpent' => $this->getTimeSpent(), 'workCostEstimate' => $this->getWorkCostEstimate(), 'materialCostEstimate' => $this->getMaterialCostEstimate(), 'usedMaterials' => $this->getUsedMaterials() ?? [], 'workDone' => $this->getWorkDone() ?? [], 'createdAt' => $this->getCreatedAt(), 'faultSnapshots' => $this->getSnapshots()->toArray() ?? [], 'comments' => $this->getComments()->toArray() ?? [], 'mustLowerCost' => $this->isMustLowerCost(), 'allocatedExpense' => $this->getAllocatedExpense(), ]; } }