/** * Set mime type for current file * * @param string $mime Mime type or file full path * @param bool $isPath * @return $this */ public function setMime($mime, $isPath = false) { if ($isPath) { $this->mime->setMimeByPath($mime); } else { $this->mime->setMime($mime); } $this->file->mime = $this->mime->getFileType(); $this->file->type = $this->mime->getMediaType(); $this->file->mimetype = $this->mime->getMimeType(); return $this; }
/** * Initialise new instance of Folder service * * @param Url $url * @param FolderDto $folder * @param Mime $mime * @param Icon $icon */ public function __construct(Url $url, FolderDto $folder, Mime $mime, Icon $icon) { $this->url = $url; $this->folder = $folder; $this->folder->thumb = $icon->get($mime->setMime('dir')); }