mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
- Added method getGemeindeByPlz to controller Gemeinde
This commit is contained in:
@@ -31,9 +31,9 @@ class Gemeinde extends APIv1_Controller
|
||||
*/
|
||||
public function getGemeinde()
|
||||
{
|
||||
$gemeindeID = $this->get('gemeinde_id');
|
||||
$gemeindeID = $this->get("gemeinde_id");
|
||||
|
||||
$this->GemeindeModel->addOrder('plz');
|
||||
$this->GemeindeModel->addOrder("plz");
|
||||
if (isset($gemeindeID))
|
||||
{
|
||||
$result = $this->GemeindeModel->load($gemeindeID);
|
||||
@@ -42,8 +42,28 @@ class Gemeinde extends APIv1_Controller
|
||||
{
|
||||
$result = $this->GemeindeModel->load();
|
||||
}
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function getGemeindeByPlz()
|
||||
{
|
||||
$plz = $this->get("plz");
|
||||
|
||||
if (is_numeric($plz))
|
||||
{
|
||||
$result = $this->GemeindeModel->loadWhere(array('plz' => $plz));
|
||||
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->response();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
|
||||
Reference in New Issue
Block a user