wip: added rest api endpoint shiai
This commit is contained in:
@@ -15,6 +15,12 @@ class Shiai
|
||||
private $galleryUrl = null; //< url of the gallery to a gallery of the shiai
|
||||
private $promoImgUrl = null; //< promotional image for the shiai (as url)
|
||||
|
||||
/** name of the table in the db holding the Shiai-s
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
private static $tableName = "wettkampfkalender";
|
||||
|
||||
public function __construct($id, $date, $name, $ageclasses, $place, $announcementUrl, $routeUrl, $galleryUrl, $promoImgUrl)
|
||||
{
|
||||
//! @todo input validation and sanitation
|
||||
@@ -83,6 +89,17 @@ class Shiai
|
||||
return self::fromDbArray($response[0]);
|
||||
}
|
||||
|
||||
/** select shiai from the database
|
||||
*
|
||||
* - by default, only coming events will be returned
|
||||
*/
|
||||
public static function dbSelect(){
|
||||
$query = "SELECT `".self::$tableName."`.* FROM `".self::$tableName."` WHERE `Datum` >= CURDATE();";
|
||||
$response = dbConnector::query($query);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
public static function fromDbArray($member)
|
||||
{
|
||||
return new shiai(
|
||||
|
||||
Reference in New Issue
Block a user