Improve : set and setp return $this

This commit is contained in:
sparkyx 2022-03-08 09:21:42 +01:00
parent 3792b5dd97
commit 081bc8ac4e

View file

@ -134,6 +134,7 @@ abstract class Data_SQL
{ {
if (array_key_exists($p_string, $this->type)) { if (array_key_exists($p_string, $this->type)) {
$this->$p_string=$p_value; $this->$p_string=$p_value;
return $this;
} else } else
throw new Exception(__FILE__.":".__LINE__.$p_string.'Erreur attribut inexistant '.$p_string); 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)) { if (array_key_exists($p_string, $this->name)) {
$idx=$this->name[$p_string]; $idx=$this->name[$p_string];
$this->$idx=$p_value; $this->$idx=$p_value;
return $this;
} else } else
throw new Exception(__FILE__.":".__LINE__.$p_string.'Erreur attribut inexistant '.$p_string); throw new Exception(__FILE__.":".__LINE__.$p_string.'Erreur attribut inexistant '.$p_string);
} }