/** * Set current file thumb property * * @param bool $uploading * @return $this * @throws FileManagerException */ public function setFileThumb($uploading = false) { if ($this->isImage()) { $this->file->thumb = $this->url->forName($this->getPath(), $this->fullName(), 'thumb'); if (!$uploading) { list($width, $height) = getimagesize($this->fullPath()); $this->file->size = [$width, $height]; $this->file->thumbs = $this->thumb->details($this); } } else { $this->file->thumb = $this->icon->get($this->mime); } 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')); }