コード例 #1
0
 /**
  * @return \Generator
  */
 public function fetchAll()
 {
     $slugs = $this->filesystem->foldersNames('/');
     foreach ($slugs as $slug) {
         if ($this->filesystem->has($this->generateFileNameFromSlug($slug))) {
             (yield $this->fetchBySlug($slug));
         }
     }
 }
コード例 #2
0
 /**
  * @param $slug
  * @return bool
  */
 public function hasImageFor($slug)
 {
     $path = $this->generateBasePath($slug);
     $filePath = $this->composeJpgFilePath($slug, $path);
     return $this->filesystem->has($filePath);
 }