コード例 #1
0
ファイル: Songs.php プロジェクト: pldin601/HomeMusic
 /**
  * @param $track_artist
  * @return MLArray
  */
 public static function deleteByArtist($track_artist)
 {
     $songs = SongDao::getList([TSongs::T_ARTIST => $track_artist, TSongs::USER_ID => self::$me->getId()]);
     $to_remove = $songs->map(Mapper::key(TSongs::ID));
     if (count($to_remove) == 0) {
         return array();
     }
     return (new DeleteQuery(TSongs::_NAME))->where(TSongs::ID, $to_remove->mkArray())->returning("*")->fetchAll();
 }
コード例 #2
0
ファイル: DoPlaylists.php プロジェクト: pldin601/HomeMusic
 public function doGet(JsonResponse $response, LoggedIn $me)
 {
     $playlists = PlaylistDao::getList([TPlaylists::USER_ID => $me->getId()]);
     $playlist_objects = $playlists->map(Mapper::call(Playlist::class, "new"));
     $response->write($playlist_objects);
 }