2026-06-03 17:33:56 +02:00
|
|
|
<?php
|
|
|
|
|
defined('BASEPATH') OR exit('No direct script access allowed');
|
|
|
|
|
|
|
|
|
|
class Genre_model extends CI_Model {
|
|
|
|
|
|
|
|
|
|
public function __construct() {
|
|
|
|
|
parent::__construct();
|
2026-06-10 16:31:05 +02:00
|
|
|
$this->load->database();
|
2026-06-03 17:33:56 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function get_all() {
|
|
|
|
|
$query = $this->db->get('genre');
|
|
|
|
|
return $query->result_array();
|
|
|
|
|
}
|
2026-06-10 16:31:05 +02:00
|
|
|
|
|
|
|
|
public function get_by_game($game_id) {
|
|
|
|
|
$this->db->select('genre.*');
|
|
|
|
|
$this->db->from('genre');
|
|
|
|
|
|
|
|
|
|
$this->db->join('game_genre', 'game_genre.genreId = genre.genreId');
|
|
|
|
|
|
|
|
|
|
$this->db->where('game_genre.gameId', $game_id);
|
|
|
|
|
|
|
|
|
|
$query = $this->db->get();
|
|
|
|
|
return $query->result_array();
|
|
|
|
|
}
|
2026-06-03 17:33:56 +02:00
|
|
|
}
|