$query = $this->CI->db->get($this->foreign_table); return $query->result_array();
$this->CI->db->from($this->foreign_table); foreach($this->params['access_restriction'] as $k=>$v){ $this->CI->db->where($k,$v); } return $query->get()->result_array();
second_table: class: ManyToMany params: ... access_restriction: field: value
$query = $this->CI->db->from($this->foreign_table); if (isset($this->params['access_restriction'])) { foreach($this->params['access_restriction'] as $k=>$v){ if (is_array($v)) { $this->CI->db->where_in($k, $v); } else { $this->CI->db->where($k,$v); } } } return $query->get()->result_array();
... 'class' => 'ManyToMany', 'params' => array ( 'display_field' => 'name', 'access_restriction' => Array( 'language_id' => Array(0,1,2,3), ) ) ...