* Fixed compatibility with PHP 5.3

This commit is contained in:
alextselegidis@gmail.com 2013-07-26 06:16:24 +00:00
parent 2dd4a48631
commit c581c341ac
4 changed files with 14 additions and 9 deletions

View file

@ -33,6 +33,8 @@ class Unit_tests extends CI_Driver_Library {
* If a new group of tests is added, it should be also added in * If a new group of tests is added, it should be also added in
* this method, in order to be executed when all the tests need to * this method, in order to be executed when all the tests need to
* be run. * be run.
*
* @task In order to run the tests the user must be logged in as admin.
*/ */
public function run_all_tests() { public function run_all_tests() {
$this->run_model_tests(false); $this->run_model_tests(false);

View file

@ -28,8 +28,7 @@ class Customers_Model extends CI_Model {
// :: CHECK IF CUSTOMER ALREADY EXIST (FROM EMAIL). // :: CHECK IF CUSTOMER ALREADY EXIST (FROM EMAIL).
if ($this->exists($customer) && !isset($customer['id'])) { if ($this->exists($customer) && !isset($customer['id'])) {
// Find the customer id from the database. // Find the customer id from the database.
$customer['id'] = $this->get_batch( $customer['id'] = $this->find_record_id($customer);
array('email' => $customer['email']))[0]['id'];
} }
// :: INSERT OR UPDATE CUSTOMER RECORD // :: INSERT OR UPDATE CUSTOMER RECORD
@ -260,8 +259,9 @@ class Customers_Model extends CI_Model {
. 'exist in the database : ' . $field_name); . 'exist in the database : ' . $field_name);
} }
return $this->db->get_where('ea_users', array('id' => $customer_id)) $customer = $this->db->get_where('ea_users', array('id' => $customer_id))->row_array();
->row_array()[$field_name];
return $customer[$field_name];
} }
/** /**

View file

@ -53,8 +53,9 @@ class Providers_Model extends CI_Model {
. 'database : ' . $field_name); . 'database : ' . $field_name);
} }
return $this->db->get_where('ea_users', array('id' => $provider_id)) $provider = $this->db->get_where('ea_users', array('id' => $provider_id))->row_array();
->row_array()[$field_name];
return $provider[$field_name];
} }
/** /**
@ -146,8 +147,9 @@ class Providers_Model extends CI_Model {
* @return string Returs the value of the selected user setting. * @return string Returs the value of the selected user setting.
*/ */
public function get_setting($setting_name, $provider_id) { public function get_setting($setting_name, $provider_id) {
return $this->db->get_where('ea_user_settings', array('id_users' => $provider_id)) $provider_settings = $this->db->get_where('ea_user_settings',
->row_array()[$setting_name]; array('id_users' => $provider_id))->row_array();
return $provider_settings[$setting_name];
} }
/** /**

View file

@ -220,7 +220,8 @@ class Services_Model extends CI_Model {
throw new Exception('The given $field_name argument does not exist in the database : ' . $field_name); throw new Exception('The given $field_name argument does not exist in the database : ' . $field_name);
} }
return $this->db->get_where('ea_services', array('id' => $service_id))->row_array()[$field_name]; $setting = $this->db->get_where('ea_services', array('id' => $service_id))->row_array();
return $setting[$field_name];
} }
/** /**