user); $this->setApplication($application); } public function setApplication(BachelorApplication $application): void { $this->application = $application; } public function getApplication(): BachelorApplication { return $this->application; } protected function prepareAttachment(Attachment $attachment): Attachment { $newAttachment = parent::prepareAttachment($attachment); $newAttachment->application_id = $this->getApplication()->id; return $newAttachment; } protected function prepareChange(): ChangeHistory { $change = parent::prepareChange(); $change->application_id = $this->application->id; return $change; } }