public function doGetSubDirectory(Image $image, array $options) { $subDirs = []; $formats = str_split($options['format']); foreach ($formats as $format) { $subDirs[] = $image->getDateUploaded()->format($format); } $subDir = implode(DIRECTORY_SEPARATOR, $subDirs); if ($options['include_id']) { return $subDir . DIRECTORY_SEPARATOR . $image->getId(); } return $subDir; }
public function getImageUrl(Image $image) { $config = $this->getConfig($image->getConfig()->getKey()); $host = $config['host']; $subDir = $this->getImageSubDir($image); $name = $this->getImageName($image); return sprintf($host, ($subDir ? $subDir . '/' : '') . $name); }
protected function doGetSubDirectory(Image $image, array $options) { $subDir = $image->getId() % $options['dirs']; return $subDir . DIRECTORY_SEPARATOR . $image->getId(); }