/** * Retrieves a playlist by id. * * @param PlaylistIdentity $identity The identity of the playlist. * @return Playlist */ public function get(PlaylistIdentity $identity) { if (!isset($this->content[$identity->getId()])) { throw new PlaylistNotFoundException(); } $raw_playlist = $this->content[$identity->getId()]; return $this->buildPlaylist($raw_playlist); }
public function get(PlaylistIdentity $identity) { $playlist = $this->redis->getItemFromList(self::KEY, $identity->getId()); if (!$playlist) { $playlist = $this->repository->get($identity); $this->redis->saveItemInList(self::KEY, $playlist); } return $playlist; }
/** * Returns the id of the playlist. * * @return string */ public function getId() { return $this->id->getId(); }