コード例 #1
0
 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;
 }
コード例 #2
0
 protected function doGetSubDirectory(Image $image, array $options)
 {
     $subDir = $image->getId() % $options['dirs'];
     return $subDir . DIRECTORY_SEPARATOR . $image->getId();
 }