protected function getAlbums(PathInfo $pathInfo) { $galleryPath = '/' . implode('/', array($pathInfo->getPid(), $pathInfo->getGalleryUId())); if (!array_key_exists($galleryPath, $this->yagDirectoryCache)) { $this->yagDirectoryCache[$galleryPath] = array(); $albums = $this->albumRepository->findByGallery($pathInfo->getGalleryUId()); foreach ($albums as $album) { $this->yagDirectoryCache[$galleryPath][$album->getUid()] = $this->buildAlbumObjectInfo($pathInfo, $album); $this->yagDirectoryPathCache[$galleryPath . '/' . $album->getUid()] = true; } } return $this->yagDirectoryCache[$galleryPath]; }