backup du projet
This commit is contained in:
29
entities/mother_entity.php
Normal file
29
entities/mother_entity.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Classe d'un Mere de tout objet
|
||||
* @author Yass & Laura
|
||||
*/
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function nettoyer(string $strText){
|
||||
$strText = trim($strText);
|
||||
$strText = str_replace("<script>", "", $strText);
|
||||
$strText = str_replace("</script>", "", $strText);
|
||||
return $strText;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user