<commit_before><?php

/**
 * @author Fathoni <<EMAIL>>
 * @property CI_DB_query_builder $db
 * @property int $mahasiswa_id
 * @property Mahasiswa_model $mahasiswa
 */
class Anggota_proposal_model extends CI_Model
{	
	public function add(stdClass $model)
	{
		$result = $this->db->insert('anggota_proposal', $model);
		
		if ($result)
		{
			$model->id = $this->db->insert_id();
		}
		
		return $result;
	}
	
	public function is_sudah_terdaftar($mahasiswa_id, $kegiatan_id)
	{
		$count = $this->db
			->from('anggota_proposal a')
			->join('proposal p', 'p.id = a.proposal_id')
			->where('a.mahasiswa_id', $mahasiswa_id)
			->where('p.kegiatan_id', $kegiatan_id)
			->count_all_results();
		
		return ($count > 0);
	}
	
	public function get_ketua($proposal_id)
	{
		return $this->db->get_where('anggota_proposal', ['proposal_id' => $proposal_id, 'no_urut' => 1], 1)->row();
	}
	
	/**
	 * @param int $proposal_id
	 * @return Anggota_proposal_model[] 
	 */
	public function list_by_proposal($proposal_id)
	{
		return $this->db
			->order_by('no_urut')
			->get_where('anggota_proposal', ['proposal_id' => $proposal_id])->result();
	}
	
	public function delete_by_proposal($proposal_id)
	{
		return $this->db->delete('anggota_proposal', ['proposal_id' => $proposal_id]);
	}
}
<commit_msg>Menambahkan fungsi get()<commit_after><?php

/**
 * @author Fathoni <<EMAIL>>
 * @property CI_DB_query_builder $db
 * @property int $mahasiswa_id
 * @property Mahasiswa_model $mahasiswa
 */
class Anggota_proposal_model extends CI_Model
{	
	public function add(stdClass $model)
	{
		$result = $this->db->insert('anggota_proposal', $model);
		
		if ($result)
		{
			$model->id = $this->db->insert_id();
		}
		
		return $result;
	}
	
	public function get($id)
	{
		return $this->db->get_where('anggota_proposal', ['id' => $id], 1)->row();
	}
	
	public function is_sudah_terdaftar($mahasiswa_id, $kegiatan_id)
	{
		$count = $this->db
			->from('anggota_proposal a')
			->join('proposal p', 'p.id = a.proposal_id')
			->where('a.mahasiswa_id', $mahasiswa_id)
			->where('p.kegiatan_id', $kegiatan_id)
			->count_all_results();
		
		return ($count > 0);
	}
	
	public function get_ketua($proposal_id)
	{
		return $this->db->get_where('anggota_proposal', ['proposal_id' => $proposal_id, 'no_urut' => 1], 1)->row();
	}
	
	/**
	 * @param int $proposal_id
	 * @return Anggota_proposal_model[] 
	 */
	public function list_by_proposal($proposal_id)
	{
		return $this->db
			->order_by('no_urut')
			->get_where('anggota_proposal', ['proposal_id' => $proposal_id])->result();
	}
	
	public function delete_by_proposal($proposal_id)
	{
		return $this->db->delete('anggota_proposal', ['proposal_id' => $proposal_id]);
	}
}

{'fraction_non_alphanumeric': 0.17762913415087328, 'fraction_numerical': 0.002601263470828688, 'mean_word_length': 4.493877551020408, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 61, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3627528', 'n_tokens_mistral': 1181, 'n_tokens_neox': 1080, 'n_words': 172}