person model: added method that return list of db columns

This commit is contained in:
Stefan Puraner
2016-05-10 13:46:01 +02:00
parent 28e1707b4e
commit 440cac91d6
2 changed files with 44 additions and 3 deletions
@@ -60,7 +60,8 @@ class Person extends APIv1_Controller
}
else
{
$this->response();
$fields = $this->PersonModel->getFields();
$this->response($fields, REST_Controller::HTTP_OK);
}
}
+42 -2
View File
@@ -11,11 +11,51 @@ class Person_model extends DB_Model
$this->dbTable = 'public.tbl_person';
$this->pk = 'person_id';
}
public function getFields()
{
$fields = array(
//Tabellenspalten
"person_id" => NULL,
"sprache" => NULL,
"anrede" => NULL,
"titelpost" => NULL,
"titelpre" => NULL,
"nachname" => NULL,
"vorname" => NULL,
"vornamen" => NULL,
"gebdatum" => NULL,
"gebort" => NULL,
"gebzeit" => NULL,
"foto" => NULL,
"anmerkungen" => NULL,
"homepage" => NULL,
"svnr" => NULL,
"ersatzkennzeichen" => NULL,
"familienstand" => NULL,
"anzahlkinder" => NULL,
"aktiv"=>TRUE,
"insertamum" => NULL,
"insertvon" => NULL,
"updateamum" => NULL,
"updatevon" => NULL,
"geschlecht" => "u",
"staatsbuergerschaft" => NULL,
"geburtsnation" => NULL,
"ext_id" => NULL,
"kurzbeschreibung"> NULL,
"zugangscode" => NULL,
"foto_sperre" => FALSE,
"matr_nr"=> NULL
);
return $this->_success($fields);
}
/**
*
*/
/*public function checkBewerbung($email, $studiensemester_kurzbz = NULL)
public function checkBewerbung($email, $studiensemester_kurzbz = NULL)
{
$this->db->distinct();
@@ -51,5 +91,5 @@ class Person_model extends DB_Model
;
}
return $this->db->get()->result_array();
}*/
}
}