smarty et merge de tout fini ( ദ്ദി ˙ᗜ˙ )
This commit is contained in:
parent
a774205594
commit
6ed4394dda
113 changed files with 11964 additions and 1192 deletions
|
|
@ -9,11 +9,11 @@ require_once("mother_entity.php");
|
|||
|
||||
class Category extends Entity{
|
||||
|
||||
private int $_id;
|
||||
protected string $_name = '';
|
||||
protected string $_parent = '';
|
||||
private ?int $_id = null;
|
||||
protected string $_name = '';
|
||||
protected ?int $_parent = null;
|
||||
|
||||
/**
|
||||
/**
|
||||
* Constructeur (j'ai toujours pas compris à quoi ça sert)
|
||||
*/
|
||||
public function __construct(){
|
||||
|
|
@ -26,7 +26,7 @@ class Category extends Entity{
|
|||
* Récuperation de l'id de la catégorie
|
||||
* @return int l'id de la catégorie
|
||||
*/
|
||||
public function getId():int{
|
||||
public function getId(): ?int{
|
||||
return $this->_id;
|
||||
}
|
||||
|
||||
|
|
@ -35,7 +35,11 @@ class Category extends Entity{
|
|||
* @param int le nouvelle id
|
||||
*/
|
||||
public function setId($id){
|
||||
$this->_id = $id;
|
||||
if (empty($id)) {
|
||||
$this->_id = null;
|
||||
} else {
|
||||
$this->_id = (int) $id;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -56,18 +60,22 @@ class Category extends Entity{
|
|||
|
||||
/**
|
||||
* Récuperation du nom du parent de la catégorie
|
||||
* @return string nom de la catégorie
|
||||
* @return int nom de la catégorie
|
||||
*/
|
||||
public function getParent(){
|
||||
public function getParent():?int{
|
||||
return $this->_parent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mise à jour du nom du parent de la catégorie
|
||||
* @param string le nouveau nom de la catégorie
|
||||
* @param int le nouveau nom de la catégorie
|
||||
*/
|
||||
public function setParent($parent){
|
||||
$this->_parent = $parent;
|
||||
if (empty($parent)) {
|
||||
$this->_parent = null;
|
||||
} else {
|
||||
$this->_parent = (int) $parent;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue