<?

class playlist extends item {

	public function __construct() {
		$this->set('playlists');
	}

	public function get_playlist($id) {
		$query = 'SELECT * FROM playlist WHERE id = ?';
		$playlist = $this->sql->get_row($query, [$id]);

		$object->log($playlist['type'].' - type');

		if($playlist['type'] == 1) {
			$query = 'SELECT * FROM template_items WHERE playlist_template_id = ?';
			$template_items = $this->sql->get_rows($query, [$id]);

			$playlist['template_items'] = $template_items;

			$object->log($object->toJSON($template_items));
		}/* else {

		}*/

		return $playlist;
	}
}

?>