Améloration de la structure du code

This commit is contained in:
Yasder5 2026-01-14 20:52:19 +01:00
parent 5218b016f4
commit fc234e4438
8 changed files with 320 additions and 31 deletions

View file

@ -0,0 +1,22 @@
<?php
/**
* Classe d'un Mere de tout objet
* @author Yass
*/
class Entity{
protected string $_prefix = '';
public function hydrate(array $arrData){
foreach($arrData as $key=>$value){
$strMethodName = "set".ucfirst(str_replace($this->_prefix,'',$key));
if (method_exists($this,$strMethodName)){
$this->$strMethodName($value);
}
}
}
}