Example #1
0
 /**
  * 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);
 }
Example #2
0
 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;
 }
Example #3
0
 /**
  * Returns the id of the playlist.
  *
  * @return string
  */
 public function getId()
 {
     return $this->id->getId();
 }