db->getRows( $this->db->q(' SELECT * FROM musicbrainz.bh_release WHERE release_group IN (\''. implode('\',\'', $release_groups) .'\') '. ($only_official ? 'AND type = 1' : 'AND type IS NOT NULL') .' ORDER BY date ASC, id ASC '), 'id' ); if ($group_by_release) { $g_releases = array(); foreach ($releases as $release) { if (!isset($g_releases[$release['release_group']])) { $g_releases[$release['release_group']] = array(); } $g_releases[$release['release_group']][$release['id']] = $release; } return $g_releases; } else { return $releases; } } }