Tests bis zu Gericht Model
This commit is contained in:
@@ -1,44 +1,50 @@
|
||||
<?php
|
||||
//Programmierung: Sven Alteköster 100%
|
||||
//Getestet durch:
|
||||
//Getestet durch: Samuel Wolff
|
||||
|
||||
namespace ppb\Controller;
|
||||
|
||||
use ppb\Library\Msg;
|
||||
use ppb\Model\BestellungModel;
|
||||
|
||||
class BestellungController {
|
||||
|
||||
private $db;
|
||||
|
||||
public function __construct() {
|
||||
$this->db = new BestellungModel();
|
||||
class BestellungController
|
||||
{
|
||||
|
||||
private $db;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->db = new BestellungModel();
|
||||
}
|
||||
|
||||
public function getBestellung($id = false)
|
||||
{
|
||||
$result = $this->db->selectBestellung($id);
|
||||
if ($id !== false) {
|
||||
if ($result)
|
||||
$result = $result[0];
|
||||
else
|
||||
$result = false;
|
||||
}
|
||||
|
||||
public function getBestellung($id=false) {
|
||||
$result=$this->db->selectBestellung($id);
|
||||
if($id !== false){
|
||||
if($result)
|
||||
$result=$result[0];
|
||||
else
|
||||
$result=false;
|
||||
}
|
||||
|
||||
return json_encode($result);
|
||||
}
|
||||
return json_encode($result);
|
||||
}
|
||||
|
||||
public function writeBestellung($data){
|
||||
$result=$this->db->insertGericht($data);
|
||||
return json_encode($result);
|
||||
}
|
||||
public function writeBestellung($data)
|
||||
{
|
||||
$result = $this->db->insertBestellung($data);
|
||||
return json_encode($result);
|
||||
}
|
||||
|
||||
public function updateBestellung($id, $data){
|
||||
$result=$this->db->updateBestellung($id, $data);
|
||||
return json_encode($result);
|
||||
}
|
||||
|
||||
public function deleteBestellung($id){
|
||||
$result=$this->db->deleteBestellung($id);
|
||||
return json_encode($result);
|
||||
}
|
||||
public function updateBestellung($id, $data)
|
||||
{
|
||||
$result = $this->db->updateBestellung($id, $data);
|
||||
return json_encode($result);
|
||||
}
|
||||
|
||||
public function deleteBestellung($id)
|
||||
{
|
||||
$result = $this->db->deleteBestellung($id);
|
||||
return json_encode($result);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user