@@ 951-968 (lines=18) @@ | ||
948 | * @param $songId |
|
949 | * @return Instrument[] |
|
950 | */ |
|
951 | public function fetchInstrumentsForSongId($songId) |
|
952 | { |
|
953 | $instrumentRows = $this->dbConn->fetchAll( |
|
954 | 'SELECT i.* FROM songs_x_instruments si |
|
955 | INNER JOIN instruments i ON si.instrumentId = i.id WHERE si.songId = :songId', |
|
956 | ['songId' => $songId] |
|
957 | ); |
|
958 | ||
959 | $dbConn = $this; |
|
960 | $instruments = array_map( |
|
961 | function ($row) use ($dbConn) { |
|
962 | return $dbConn->buildInstrumentFromDbRow($row); |
|
963 | }, |
|
964 | $instrumentRows |
|
965 | ); |
|
966 | ||
967 | return $instruments; |
|
968 | } |
|
969 | ||
970 | /** |
|
971 | * @param $songId |
|
@@ 974-991 (lines=18) @@ | ||
971 | * @param $songId |
|
972 | * @return Platform[] |
|
973 | */ |
|
974 | public function fetchPlatformsForSongId($songId) |
|
975 | { |
|
976 | $platformRows = $this->dbConn->fetchAll( |
|
977 | 'SELECT p.* FROM songs_x_platforms sp |
|
978 | INNER JOIN platforms p ON sp.platformId = p.id WHERE sp.songId = :songId', |
|
979 | ['songId' => $songId] |
|
980 | ); |
|
981 | ||
982 | $dbConn = $this; |
|
983 | $platforms = array_map( |
|
984 | function ($row) use ($dbConn) { |
|
985 | return $dbConn->buildPlatformFromDbRow($row); |
|
986 | }, |
|
987 | $platformRows |
|
988 | ); |
|
989 | ||
990 | return $platforms; |
|
991 | } |
|
992 | ||
993 | /** |
|
994 | * @param $row |