_primary_key; // // } // // $this->db->order_by($this->clean_alpha_num_field($order_by), $this->clean_alpha_field($direction)); // // if (!empty($where)) { // // foreach ($where as $field => $value) { // // if (is_numeric($field) && strlen($value) > 0) { // // $this->db->where($value); // // continue; // // } // // if ($field === NULL && $value === NULL) { // // continue; // // } // // if ($value !== NULL) { // // if (is_numeric($value)) { // // $this->db->where($field, $value); // // continue; // // } // // if (is_string($value)) { // // $this->db->like($field, $value); // // continue; // // } // // $this->db->where($field, $value); // // } // // } // // } // // $query = $this->db->get($this->_table); // $sql = []; // foreach ($where as $key => $value) { // if (is_string($value) && strlen($value) > 0) { // $sql[] = "$key"; // } else { // $sql[] = "$key = $value"; // } // } // return R::findAll($this->_table, implode(' AND ', $sql)); // $result = []; // // if ($query->num_rows() > 0) { // // foreach ($query->result() as $row) { // // $result[] = $row; // // } // // } // return $result; // } }