From 606bd3d3429a848d9f2d3f6b746deb9d9d244342 Mon Sep 17 00:00:00 2001 From: paolo Date: Fri, 20 May 2016 14:07:31 +0200 Subject: [PATCH] Added method PrestudentByPersonID to Prestudent controller --- .../controllers/api/v1/crm/Prestudent.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/application/controllers/api/v1/crm/Prestudent.php b/application/controllers/api/v1/crm/Prestudent.php index 28b8eddd1..d334cc709 100644 --- a/application/controllers/api/v1/crm/Prestudent.php +++ b/application/controllers/api/v1/crm/Prestudent.php @@ -46,6 +46,25 @@ class Prestudent extends APIv1_Controller $this->response(); } } + + /** + * @return void + */ + public function getPrestudentByPersonID() + { + $person_id = $this->get('person_id'); + + if (isset($person_id)) + { + $result = $this->PrestudentModel->load(array('person_id' => $person_id)); + + $this->response($result, REST_Controller::HTTP_OK); + } + else + { + $this->response(); + } + } /** * @return void