From 5431d25f0b54c258ae5b37bb7b057e5c1bad092a Mon Sep 17 00:00:00 2001 From: Alex Tselegidis Date: Sun, 16 Oct 2022 18:08:33 +0300 Subject: [PATCH] Use variables by reference in the foreach loops of the models --- application/models/Categories_model.php | 2 +- application/models/Customers_model.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/application/models/Categories_model.php b/application/models/Categories_model.php index 8f6f50f5..63e64435 100644 --- a/application/models/Categories_model.php +++ b/application/models/Categories_model.php @@ -252,7 +252,7 @@ class Categories_model extends EA_Model { $categories = $this->db->get('categories', $limit, $offset)->result_array(); - foreach ($categories as $category) + foreach ($categories as &$category) { $this->cast($category); } diff --git a/application/models/Customers_model.php b/application/models/Customers_model.php index 3223b7b1..3293b483 100644 --- a/application/models/Customers_model.php +++ b/application/models/Customers_model.php @@ -459,7 +459,7 @@ class Customers_model extends EA_Model { ->get() ->result_array(); - foreach ($customers as $customer) + foreach ($customers as &$customer) { $this->cast($customer); }