mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-02 04:39:28 +00:00
f3b79cd731
- Added method toPhp to DB_Model to convert array and boolean types from PostgresSQL to php - Added method execQuery to DB_Model to execute a query (it calls toPhp) - Added method pgsqlArrayToPhpArray to convert a pgsql array to php - Updated DB_Model methods to using chkRights (and toPhp where it is needed) - Removed methods escapeArray and _pgsqlArrayToPhpArray from controller APIv1_Controller - Removed escapeArray from controllers Dokumentstudiengang and Dokument - Updated models to use execQuery (and chkRights where it is needed)
45 lines
863 B
PHP
45 lines
863 B
PHP
<?php
|
|
|
|
require_once APPPATH . '/libraries/REST_Controller.php';
|
|
|
|
class APIv1_Controller extends REST_Controller
|
|
{
|
|
function __construct()
|
|
{
|
|
parent::__construct();
|
|
|
|
// Loads return messages
|
|
$this->load->helper('Message');
|
|
}
|
|
|
|
/**
|
|
*
|
|
* @param type $data
|
|
* @return typeparses empty string to NULL
|
|
*/
|
|
protected function _parseData($data)
|
|
{
|
|
if(is_array($data))
|
|
{
|
|
foreach($data as $key=>$value)
|
|
{
|
|
if($value === '')
|
|
{
|
|
$data[$key] = NULL;
|
|
}
|
|
}
|
|
return $data;
|
|
}
|
|
elseif(is_object($data))
|
|
{
|
|
//TODO
|
|
}
|
|
else
|
|
{
|
|
if($data == '')
|
|
{
|
|
return NULL;
|
|
}
|
|
}
|
|
}
|
|
} |