Files
FHC-Core/application/controllers/api/v1/lehre/Studiengang.php
T
paolo a3a9c42e99 - Renamed classes, methods and properties names in german
- All the controllers exends APIv1_Controller rather than REST_Controller
 - Codeceptions modified to be compliant to changes
2016-04-25 15:57:52 +02:00

55 lines
1.2 KiB
PHP

<?php
/**
* FH-Complete
*
* @package FHC-API
* @author FHC-Team
* @copyright Copyright (c) 2016, fhcomplete.org
* @license GPLv3
* @link http://fhcomplete.org
* @since Version 1.0
* @filesource
*/
// ------------------------------------------------------------------------
if(!defined('BASEPATH')) exit('No direct script access allowed');
class Studiengang extends APIv1_Controller
{
/**
* Course API constructor.
*/
public function __construct()
{
parent::__construct();
// Load model PersonModel
$this->load->model('lehre/studiengang_model', 'StudiengangModel');
// Load set the addonID of the model to let to check the permissions
$this->StudiengangModel->setAddonID($this->_getAddonID());
}
public function getAllForBewerbung()
{
$result = $this->StudiengangModel->getAllForBewerbung();
if(is_object($result) && $result->num_rows() > 0)
{
$payload = [
'success' => TRUE,
'message' => 'Courses found',
'data' => $result->result()
];
$httpstatus = REST_Controller::HTTP_OK;
}
else
{
$payload = [
'success' => FALSE,
'message' => 'No courses found'
];
$httpstatus = REST_Controller::HTTP_OK;
}
$this->response($payload, $httpstatus);
}
}