36 lines
		
	
	
		
			667 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			36 lines
		
	
	
		
			667 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?php
 | 
						|
 | 
						|
class Musicbrainz_ReleaseGroupModel extends Model {
 | 
						|
	
 | 
						|
	public function getArtistAlbums($artist_ids) {
 | 
						|
		return $this->db->getRows(
 | 
						|
			$this->db->q('
 | 
						|
				SELECT *
 | 
						|
				FROM musicbrainz.bh_release_group
 | 
						|
				WHERE
 | 
						|
					artist_id IN (\''. implode('\',\'', $artist_ids) .'\') AND
 | 
						|
					release_type = 1
 | 
						|
				ORDER BY
 | 
						|
					year ASC,
 | 
						|
					id ASC
 | 
						|
			'),
 | 
						|
			'id'
 | 
						|
		);
 | 
						|
	}
 | 
						|
	
 | 
						|
	public function getArtistAlbumsIds($artist_id) {
 | 
						|
		return array_keys($this->db->getRows(
 | 
						|
			$this->db->q('
 | 
						|
				SELECT id
 | 
						|
				FROM musicbrainz.bh_release_group
 | 
						|
				WHERE
 | 
						|
					artist_id = \''. $artist_id .'\' AND
 | 
						|
					release_type = 1
 | 
						|
				ORDER BY
 | 
						|
					year ASC,
 | 
						|
					id ASC
 | 
						|
			'),
 | 
						|
			'id'
 | 
						|
		));
 | 
						|
	}
 | 
						|
} |