*/ require_once(dirname(__FILE__) . '/basis_db.class.php'); require_once(dirname(__FILE__) . '/functions.inc.php'); class lehrtyp extends basis_db { public $result = array(); public $lehrtyp_kurzbz; public $bezeichnung; public function __construct() { parent::__construct(); } /** * Holt alle Lehrtypen aus der table tbl_lehrtyp * @return true wenn ok, false im Fehlerfall */ public function getAll(){ $qry = "SELECT * FROM lehre.tbl_lehrtyp;"; if (!$this->db_query($qry)) { $this->errormsg = 'Datensatz konnte nicht geladen werden'; return false; } while ($row = $this->db_fetch_object()) { $lehrtyp = new lehrtyp(); $lehrtyp->lehrtyp_kurzbz = $row->lehrtyp_kurzbz; $lehrtyp->bezeichnung = $row->bezeichnung; $this->result[] = $lehrtyp; } return true; } /** * Baut die Datenstruktur für senden als JSON Objekt auf */ public function cleanResult() { $data = array(); if(count($this->result)>0) { foreach ($this->result as $lt) { $obj = new stdClass(); $obj->lehrtyp_kurzbz = $lt->lehrtyp_kurzbz; $obj->bezeichnung = $lt->bezeichnung; $data[] = $obj; } } return $data; } } ?>