/** * {@inheritdoc} */ public function read() { if (null === $this->file) { return []; } return ['id' => $this->file->id()->id(), 'created_on' => $this->file->createdOn(), 'mime_type' => $this->file->mimeType()->mimeType(), 'file_name' => $this->file->name()->filename(), 'updated_on' => $this->file->updatedOn()]; }
/** * Prepares the update SQL with the file given. * * @param File $aFile The file */ private function update(File $aFile) { $this->execute('UPDATE file SET name = :name, extension = :extension, mime_type = :mimeType, updated_on = :updatedOn WHERE id = :id', ['name' => $aFile->name()->name(), 'extension' => $aFile->name()->extension(), 'mimeType' => $aFile->mimeType(), 'updatedOn' => $aFile->updatedOn(), 'id' => $aFile->id()->id()]); }
/** * {@inheritdoc} */ public function remove(File $aFile) { unset($this->files[$aFile->id()->id()]); if ($this->eventBus instanceof FileEventBus) { $this->handle($aFile->events()); } }