protected function getGalleries(PathInfo $pathInfo) { $this->initializePidDetector($pathInfo); $pagePath = '/' . $pathInfo->getPid(); if (!array_key_exists($pagePath, $this->yagDirectoryCache)) { $this->yagDirectoryCache[$pagePath] = array(); $galleries = $this->galleryRepository->findAll(); foreach ($galleries as $gallery) { /** @var \Tx_Yag_Domain_Model_Gallery $gallery */ $this->yagDirectoryCache[$pagePath][$gallery->getUid()] = $this->buildGalleryObjectInfo($pathInfo, $gallery); $this->yagDirectoryPathCache[$pagePath . '/' . $gallery->getUid()] = true; } } return $this->yagDirectoryCache[$pagePath]; }