@@ 907-924 (lines=18) @@ | ||
904 | * @param $songId |
|
905 | * @return Instrument[] |
|
906 | */ |
|
907 | public function fetchInstrumentsForSongId($songId) |
|
908 | { |
|
909 | $instrumentRows = $this->dbConn->fetchAll( |
|
910 | 'SELECT i.* FROM songs_x_instruments si |
|
911 | INNER JOIN instruments i ON si.instrumentId = i.id WHERE si.songId = :songId', |
|
912 | ['songId' => $songId] |
|
913 | ); |
|
914 | ||
915 | $dbConn = $this; |
|
916 | $instruments = array_map( |
|
917 | function ($row) use ($dbConn) { |
|
918 | return $dbConn->buildInstrumentFromDbRow($row); |
|
919 | }, |
|
920 | $instrumentRows |
|
921 | ); |
|
922 | ||
923 | return $instruments; |
|
924 | } |
|
925 | ||
926 | /** |
|
927 | * @param $songId |
|
@@ 930-947 (lines=18) @@ | ||
927 | * @param $songId |
|
928 | * @return Platform[] |
|
929 | */ |
|
930 | public function fetchPlatformsForSongId($songId) |
|
931 | { |
|
932 | $platformRows = $this->dbConn->fetchAll( |
|
933 | 'SELECT p.* FROM songs_x_platforms sp |
|
934 | INNER JOIN platforms p ON sp.platformId = p.id WHERE sp.songId = :songId', |
|
935 | ['songId' => $songId] |
|
936 | ); |
|
937 | ||
938 | $dbConn = $this; |
|
939 | $platforms = array_map( |
|
940 | function ($row) use ($dbConn) { |
|
941 | return $dbConn->buildPlatformFromDbRow($row); |
|
942 | }, |
|
943 | $platformRows |
|
944 | ); |
|
945 | ||
946 | return $platforms; |
|
947 | } |
|
948 | ||
949 | /** |
|
950 | * @param $row |