<?php
//Programmiert von: Max Heer, Getestet von: Samuel Wolff

namespace ppb\Controller;

use ppb\Libary\Msg;
use ppb\Model\InhaltsstoffModel;

class InhaltsstoffController
{

    private $db;

    public function __construct()
    {
        $this->db = new InhaltsstoffModel();
    }


    public function getInhaltsstoff()
    {
        $result = $this->db->getInhaltsstoff();
        return json_encode($result);
    }

    public function writeInhaltsstoff($data)
    {
        $result = $this->db->insertInhaltsstoff($data);
        return json_encode($result);
    }

    public function deleteInhaltsstoff($id)
    {
        $result = $this->db->deleteInhaltsstoff($id);
        return json_encode($result);
    }
}
?>