Files
FHC-Core/application/models/Nation_model.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

71 lines
1.2 KiB
PHP

<?php
class Nation_model extends DB_Model
{
protected $_bundeslandQuery = "SELECT * FROM bis.tbl_bundesland";
/**
*
*/
public function __construct()
{
parent::__construct();
}
/**
*
*/
public function getAll($notLocked = FALSE, $orderEnglish = FALSE)
{
$result = NULL;
// Checks if the operation is permitted by the API caller
// All the code should be put inside this if statement
if(isAllowed($this->getAddonID(), 'nation'))
{
$result = $this->db->query($this->_getNationQuery($notLocked, $orderEnglish));
}
return $result;
}
/**
*
*/
protected function _getNationQuery($notLocked = FALSE, $orderEnglish = FALSE)
{
$qry = "SELECT * FROM bis.tbl_nation";
if($notLocked)
{
$qry .= " WHERE sperre IS NULL";
}
if(!$orderEnglish)
{
$qry .= " ORDER BY kurztext";
}
else
{
$qry .= " ORDER BY engltext";
}
return $qry;
}
/**
*
*/
public function getBundesland()
{
$result = NULL;
// Checks if the operation is permitted by the API caller
// All the code should be put inside this if statement
if(isAllowed($this->getAddonID(), 'nation'))
{
$result = $this->db->query($this->_bundeslandQuery);
}
return $result;
}
}