Alle Controller und Models
This commit is contained in:
47
Controller/KindController.php
Normal file
47
Controller/KindController.php
Normal file
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
// Programmiert durch Samuel Wolff
|
||||
// Getestet durch: Nicht getestet
|
||||
|
||||
namespace kindergartenverwaltung\Controller;
|
||||
|
||||
use kindergartenverwaltung\Library\Msg;
|
||||
use kindergartenverwaltung\Model\KindModel;
|
||||
|
||||
class KindController{
|
||||
|
||||
private $db;
|
||||
|
||||
public function __construct(){
|
||||
$this->db = new KindModel();
|
||||
}
|
||||
|
||||
// $parentId ist standardmäßig auf false und gibt damit alle Kinder aus,
|
||||
// das setzen gibt nur Kinder eines bestimmten Benutzerkontos aus.
|
||||
public function getKind($parentId = false){
|
||||
$result = $this->db->getKind($parentId);
|
||||
|
||||
return json_encode($result);
|
||||
}
|
||||
|
||||
public function updateKind($kindId, $data){
|
||||
$result = $this->db->updateKind($kindId, $data);
|
||||
|
||||
return json_encode($result);
|
||||
}
|
||||
|
||||
public function addKind($data){
|
||||
$result = $this->db->addKind($data);
|
||||
|
||||
return json_encode($data);
|
||||
}
|
||||
|
||||
public function deleteKind($kindId){
|
||||
$result = $this->db->deleteKind($kindId);
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user