* 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
* this method, in order to be executed when all the tests need to
* be run.
*
* @task In order to run the tests the user must be logged in as admin.
*/
public function run_all_tests() {
$this->run_model_tests(false);

View file

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

View file

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