Skip to content

Commit a725913

Browse files
author
Phil Sturgeon
committed
Merge pull request chriskacerguis#216 from shiroamada/master
replace 'key' to config_item('rest_key_column')
2 parents 137ea35 + c3fefb2 commit a725913

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

application/controllers/api/key.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,22 +214,22 @@ private function _generate_key()
214214

215215
private function _get_key($key)
216216
{
217-
return $this->db->where('key', $key)->get(config_item('rest_keys_table'))->row();
217+
return $this->db->where(config_item('rest_key_column'), $key)->get(config_item('rest_keys_table'))->row();
218218
}
219219

220220
// --------------------------------------------------------------------
221221

222222
private function _key_exists($key)
223223
{
224-
return $this->db->where('key', $key)->count_all_results(config_item('rest_keys_table')) > 0;
224+
return $this->db->where(config_item('rest_key_column'), $key)->count_all_results(config_item('rest_keys_table')) > 0;
225225
}
226226

227227
// --------------------------------------------------------------------
228228

229229
private function _insert_key($key, $data)
230230
{
231231

232-
$data['key'] = $key;
232+
$data[config_item('rest_key_column')] = $key;
233233
$data['date_created'] = function_exists('now') ? now() : time();
234234

235235
return $this->db->set($data)->insert(config_item('rest_keys_table'));
@@ -239,13 +239,13 @@ private function _insert_key($key, $data)
239239

240240
private function _update_key($key, $data)
241241
{
242-
return $this->db->where('key', $key)->update(config_item('rest_keys_table'), $data);
242+
return $this->db->where(config_item('rest_key_column'), $key)->update(config_item('rest_keys_table'), $data);
243243
}
244244

245245
// --------------------------------------------------------------------
246246

247247
private function _delete_key($key)
248248
{
249-
return $this->db->where('key', $key)->delete(config_item('rest_keys_table'));
249+
return $this->db->where(config_item('rest_key_column'), $key)->delete(config_item('rest_keys_table'));
250250
}
251251
}

0 commit comments

Comments
 (0)