| @@ 981-998 (lines=18) @@ | ||
| 978 | * @param $songId |
|
| 979 | * @return Instrument[] |
|
| 980 | */ |
|
| 981 | public function fetchInstrumentsForSongId($songId) |
|
| 982 | { |
|
| 983 | $instrumentRows = $this->dbConn->fetchAll( |
|
| 984 | 'SELECT i.* FROM songs_x_instruments si |
|
| 985 | INNER JOIN instruments i ON si.instrumentId = i.id WHERE si.songId = :songId', |
|
| 986 | ['songId' => $songId] |
|
| 987 | ); |
|
| 988 | ||
| 989 | $dbConn = $this; |
|
| 990 | $instruments = array_map( |
|
| 991 | function ($row) use ($dbConn) { |
|
| 992 | return $dbConn->buildInstrumentFromDbRow($row); |
|
| 993 | }, |
|
| 994 | $instrumentRows |
|
| 995 | ); |
|
| 996 | ||
| 997 | return $instruments; |
|
| 998 | } |
|
| 999 | ||
| 1000 | /** |
|
| 1001 | * @param $songId |
|
| @@ 1004-1021 (lines=18) @@ | ||
| 1001 | * @param $songId |
|
| 1002 | * @return Platform[] |
|
| 1003 | */ |
|
| 1004 | public function fetchPlatformsForSongId($songId) |
|
| 1005 | { |
|
| 1006 | $platformRows = $this->dbConn->fetchAll( |
|
| 1007 | 'SELECT p.* FROM songs_x_platforms sp |
|
| 1008 | INNER JOIN platforms p ON sp.platformId = p.id WHERE sp.songId = :songId', |
|
| 1009 | ['songId' => $songId] |
|
| 1010 | ); |
|
| 1011 | ||
| 1012 | $dbConn = $this; |
|
| 1013 | $platforms = array_map( |
|
| 1014 | function ($row) use ($dbConn) { |
|
| 1015 | return $dbConn->buildPlatformFromDbRow($row); |
|
| 1016 | }, |
|
| 1017 | $platformRows |
|
| 1018 | ); |
|
| 1019 | ||
| 1020 | return $platforms; |
|
| 1021 | } |
|
| 1022 | ||
| 1023 | /** |
|
| 1024 | * @param $row |
|