| @@ 929-946 (lines=18) @@ | ||
| 926 | * @param $songId |
|
| 927 | * @return Instrument[] |
|
| 928 | */ |
|
| 929 | public function fetchInstrumentsForSongId($songId) |
|
| 930 | { |
|
| 931 | $instrumentRows = $this->dbConn->fetchAll( |
|
| 932 | 'SELECT i.* FROM songs_x_instruments si |
|
| 933 | INNER JOIN instruments i ON si.instrumentId = i.id WHERE si.songId = :songId', |
|
| 934 | ['songId' => $songId] |
|
| 935 | ); |
|
| 936 | ||
| 937 | $dbConn = $this; |
|
| 938 | $instruments = array_map( |
|
| 939 | function ($row) use ($dbConn) { |
|
| 940 | return $dbConn->buildInstrumentFromDbRow($row); |
|
| 941 | }, |
|
| 942 | $instrumentRows |
|
| 943 | ); |
|
| 944 | ||
| 945 | return $instruments; |
|
| 946 | } |
|
| 947 | ||
| 948 | /** |
|
| 949 | * @param $songId |
|
| @@ 952-969 (lines=18) @@ | ||
| 949 | * @param $songId |
|
| 950 | * @return Platform[] |
|
| 951 | */ |
|
| 952 | public function fetchPlatformsForSongId($songId) |
|
| 953 | { |
|
| 954 | $platformRows = $this->dbConn->fetchAll( |
|
| 955 | 'SELECT p.* FROM songs_x_platforms sp |
|
| 956 | INNER JOIN platforms p ON sp.platformId = p.id WHERE sp.songId = :songId', |
|
| 957 | ['songId' => $songId] |
|
| 958 | ); |
|
| 959 | ||
| 960 | $dbConn = $this; |
|
| 961 | $platforms = array_map( |
|
| 962 | function ($row) use ($dbConn) { |
|
| 963 | return $dbConn->buildPlatformFromDbRow($row); |
|
| 964 | }, |
|
| 965 | $platformRows |
|
| 966 | ); |
|
| 967 | ||
| 968 | return $platforms; |
|
| 969 | } |
|
| 970 | ||
| 971 | /** |
|
| 972 | * @param $row |
|