getFilenameInBundle($root); if (!array_key_exists($root, $this->attachmentsManagers)) { $this->attachmentsManagers[$root] = new AttachmentsManager($root, $this->disk); } return $this->attachmentsManagers[$root]; } /** * Save all attachments files that needs to be */ private function saveAttachments() { foreach ($this->attachmentsManagers as $manager) { $manager->save(); } } /** * Return an instance of attachments manager for specified filename */ public function attachments(string $root): AttachmentsManager { return $this->registerAttachmentsManager($root); } }