diff --git a/models/characterModel.php b/models/characterModel.php deleted file mode 100644 index a9769b0..0000000 --- a/models/characterModel.php +++ /dev/null @@ -1,54 +0,0 @@ - gateway = $gateway; - } - - public function createCharacter(int $id_character, string $name , string $img_path) : bool - { - $q = new CharacterEntity($id_character, $name, $img_path); - - return $this -> gateway -> create($q); - } - public function getCharacterById(int $id_character) : ?CharacterEntity - { - return $this -> gateway -> findById($id_character); - } - - public function getCharacterByName(string $name) : ?CharacterEntity - { - return $this -> gateway -> findByName($name); - } - - public function getAllCharacters() : array - { - return $this -> gateway -> findAll(); - } - - public function deleteCharacter(int $id_character) : bool - { - return $this -> gateway -> delete($id_character); - } - - public function updateCharacter(int $id_character, string $name, string $img_path) : bool - { - $q = $this -> gateway -> findById($id_character); - - if($q){ - $q -> setName($name); - $q -> setImgPath($img_path); - return $this -> gateway -> update($q); - } - return false; - } - -} \ No newline at end of file