From 081bc8ac4e25d7aa0ca7608256124dee57ff8c25 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Tue, 8 Mar 2022 09:21:42 +0100 Subject: [PATCH] Improve : set and setp return $this --- include/lib/data_sql.class.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/lib/data_sql.class.php b/include/lib/data_sql.class.php index ce6990e0c..5bfbaf40a 100644 --- a/include/lib/data_sql.class.php +++ b/include/lib/data_sql.class.php @@ -134,6 +134,7 @@ abstract class Data_SQL { if (array_key_exists($p_string, $this->type)) { $this->$p_string=$p_value; + return $this; } else throw new Exception(__FILE__.":".__LINE__.$p_string.'Erreur attribut inexistant '.$p_string); } @@ -161,6 +162,7 @@ abstract class Data_SQL if (array_key_exists($p_string, $this->name)) { $idx=$this->name[$p_string]; $this->$idx=$p_value; + return $this; } else throw new Exception(__FILE__.":".__LINE__.$p_string.'Erreur attribut inexistant '.$p_string); }