replace tabs with spaces
This commit is contained in:
parent
50c38e0efa
commit
c79f0f213b
176 changed files with 27652 additions and 27647 deletions
|
|
@ -1,77 +1,77 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* The Legend of Z
|
||||
*
|
||||
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
|
||||
* @copyright 2014 Heinrich-Heine-Universität Düsseldorf
|
||||
* @license http://www.gnu.org/licenses/gpl.html
|
||||
* @link https://bitbucket.org/coderkun/the-legend-of-z
|
||||
*/
|
||||
|
||||
namespace hhu\z\models;
|
||||
|
||||
|
||||
/**
|
||||
* Model to interact with Questtypes-table.
|
||||
*
|
||||
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
|
||||
*/
|
||||
class QuesttypesModel extends \hhu\z\Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Construct a new QuesttypesModel.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get all registered Questtypes.
|
||||
*
|
||||
* @return array List of registered Questtypes
|
||||
*/
|
||||
public function getQuesttypes()
|
||||
{
|
||||
return $this->db->query(
|
||||
'SELECT id, title, url, classname '.
|
||||
'FROM questtypes '.
|
||||
'ORDER BY title ASC'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a Questtype by its ID
|
||||
*
|
||||
* @param int $questtypeId ID of Questtype
|
||||
* @return array Questtype data
|
||||
*/
|
||||
public function getQuesttypeById($questtypeId)
|
||||
{
|
||||
$data = $this->db->query(
|
||||
'SELECT title, classname '.
|
||||
'FROM questtypes '.
|
||||
'WHERE id = ?',
|
||||
'i',
|
||||
$questtypeId
|
||||
);
|
||||
if(empty($data)) {
|
||||
throw new \nre\exceptions\IdNotFoundException($questtypeId);
|
||||
}
|
||||
|
||||
|
||||
return $data = $data[0];
|
||||
}
|
||||
|
||||
}
|
||||
/**
|
||||
* The Legend of Z
|
||||
*
|
||||
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
|
||||
* @copyright 2014 Heinrich-Heine-Universität Düsseldorf
|
||||
* @license http://www.gnu.org/licenses/gpl.html
|
||||
* @link https://bitbucket.org/coderkun/the-legend-of-z
|
||||
*/
|
||||
|
||||
namespace hhu\z\models;
|
||||
|
||||
|
||||
/**
|
||||
* Model to interact with Questtypes-table.
|
||||
*
|
||||
* @author Oliver Hanraths <oliver.hanraths@uni-duesseldorf.de>
|
||||
*/
|
||||
class QuesttypesModel extends \hhu\z\Model
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Construct a new QuesttypesModel.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get all registered Questtypes.
|
||||
*
|
||||
* @return array List of registered Questtypes
|
||||
*/
|
||||
public function getQuesttypes()
|
||||
{
|
||||
return $this->db->query(
|
||||
'SELECT id, title, url, classname '.
|
||||
'FROM questtypes '.
|
||||
'ORDER BY title ASC'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get a Questtype by its ID
|
||||
*
|
||||
* @param int $questtypeId ID of Questtype
|
||||
* @return array Questtype data
|
||||
*/
|
||||
public function getQuesttypeById($questtypeId)
|
||||
{
|
||||
$data = $this->db->query(
|
||||
'SELECT title, classname '.
|
||||
'FROM questtypes '.
|
||||
'WHERE id = ?',
|
||||
'i',
|
||||
$questtypeId
|
||||
);
|
||||
if(empty($data)) {
|
||||
throw new \nre\exceptions\IdNotFoundException($questtypeId);
|
||||
}
|
||||
|
||||
|
||||
return $data = $data[0];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue