mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-20 00:12:15 +00:00
- Renamed PCRMLib to CallerLib :(
- Splitted the controller PCRM in two different controllers: CallerLibrary and CallerModel
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
<?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 CallerLibrary extends APIv1_Controller
|
||||
{
|
||||
/**
|
||||
* API constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Loads the CallerLib
|
||||
$this->load->library('CallerLib');
|
||||
}
|
||||
|
||||
/**
|
||||
* Manages a HTTP get call
|
||||
*/
|
||||
public function getCall()
|
||||
{
|
||||
// Start me up!
|
||||
$result = $this->callerlib->callLibrary($this->get(), PermissionLib::SELECT_RIGHT);
|
||||
|
||||
// Print the result
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function postCall()
|
||||
{
|
||||
// Start me up!
|
||||
$result = $this->callerlib->callLibrary($this->post(), PermissionLib::UPDATE_RIGHT);
|
||||
|
||||
// Print the result
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function putCall()
|
||||
{
|
||||
// Start me up!
|
||||
$result = $this->callerlib->callLibrary($this->put(), PermissionLib::INSERT_RIGHT);
|
||||
|
||||
// Print the result
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function deleteCall()
|
||||
{
|
||||
// Start me up!
|
||||
$result = $this->callerlib->callLibrary($this->delete(), PermissionLib::DELETE_RIGHT);
|
||||
|
||||
// Print the result
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
}
|
||||
}
|
||||
+8
-8
@@ -12,9 +12,9 @@
|
||||
*/
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
if (!defined("BASEPATH")) exit("No direct script access allowed");
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class PCRM extends APIv1_Controller
|
||||
class CallerModel extends APIv1_Controller
|
||||
{
|
||||
/**
|
||||
* API constructor
|
||||
@@ -23,8 +23,8 @@ class PCRM extends APIv1_Controller
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Loads the PCRMLib
|
||||
$this->load->library("PCRMLib");
|
||||
// Loads the CallerLib
|
||||
$this->load->library('CallerLib');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -33,7 +33,7 @@ class PCRM extends APIv1_Controller
|
||||
public function getCall()
|
||||
{
|
||||
// Start me up!
|
||||
$result = $this->pcrmlib->start($this->get(), PermissionLib::SELECT_RIGHT);
|
||||
$result = $this->callerlib->callModel($this->get(), PermissionLib::SELECT_RIGHT);
|
||||
|
||||
// Print the result
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
@@ -45,7 +45,7 @@ class PCRM extends APIv1_Controller
|
||||
public function postCall()
|
||||
{
|
||||
// Start me up!
|
||||
$result = $this->pcrmlib->start($this->post(), PermissionLib::UPDATE_RIGHT);
|
||||
$result = $this->callerlib->callModel($this->post(), PermissionLib::UPDATE_RIGHT);
|
||||
|
||||
// Print the result
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
@@ -57,7 +57,7 @@ class PCRM extends APIv1_Controller
|
||||
public function putCall()
|
||||
{
|
||||
// Start me up!
|
||||
$result = $this->pcrmlib->start($this->put(), PermissionLib::INSERT_RIGHT);
|
||||
$result = $this->callerlib->callModel($this->put(), PermissionLib::INSERT_RIGHT);
|
||||
|
||||
// Print the result
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
@@ -69,7 +69,7 @@ class PCRM extends APIv1_Controller
|
||||
public function deleteCall()
|
||||
{
|
||||
// Start me up!
|
||||
$result = $this->pcrmlib->start($this->delete(), PermissionLib::DELETE_RIGHT);
|
||||
$result = $this->callerlib->callModel($this->delete(), PermissionLib::DELETE_RIGHT);
|
||||
|
||||
// Print the result
|
||||
$this->response($result, REST_Controller::HTTP_OK);
|
||||
Reference in New Issue
Block a user