protected function getYAGObjectInfoByPathInfo(PathInfo $pathInfo) { switch ($pathInfo->getPathType()) { case PathInfo::INFO_PID: return array('name' => $pathInfo->getDisplayName() . '|' . $pathInfo->getPid(), 'identifier' => $pathInfo->getIdentifier(), 'storage' => $this->storage->getUid()); break; case PathInfo::INFO_GALLERY: $gallery = $this->galleryRepository->findByUid($pathInfo->getGalleryUId()); if ($gallery instanceof \Tx_Yag_Domain_Model_Gallery) { return $this->buildGalleryObjectInfo($pathInfo, $gallery); } break; case PathInfo::INFO_ALBUM: $album = $this->albumRepository->findByUid($pathInfo->getAlbumUid()); if ($album instanceof \Tx_Yag_Domain_Model_Album) { return $this->buildAlbumObjectInfo($pathInfo, $album); } break; case PathInfo::INFO_ITEM: $item = $this->itemRepository->findByUid($pathInfo->getItemUid()); if ($item instanceof \Tx_Yag_Domain_Model_Item) { return $this->buildItemObjectInfo($pathInfo, $item); } break; } return false; }
/** * Updated description of an album * * @param int $albumUid UID of album to be updated * @param string $albumDescription Description to be set as album description * @rbacNeedsAccess * @rbacObject Album * @rbacAction edit */ public function updateAlbumDescriptionAction($albumUid, $albumDescription) { // We do this for escaping reasons $album = $this->albumRepository->findByUid($albumUid); $album->setDescription(utf8_encode($albumDescription)); $this->albumRepository->update($album); $this->returnDataAndShutDown(); }