summaryrefslogtreecommitdiff
path: root/includes/model/EventConfig_model.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2018-09-02 16:55:35 +0200
committerGitHub <noreply@github.com>2018-09-02 16:55:35 +0200
commita103bc06e28f5eca6ba9c28c81ae1227d689f224 (patch)
tree759d675b621eed86b20f14abe448e83fa8d22562 /includes/model/EventConfig_model.php
parentbd8ceda6830f97247b73932b85ce41af5b8d2ab0 (diff)
parent2bebbeb1919e1d370ac5c0668e0db5ea63e73292 (diff)
Merge pull request #452 from MyIgel/rebuild-database
Rebuild database
Diffstat (limited to 'includes/model/EventConfig_model.php')
-rw-r--r--includes/model/EventConfig_model.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/includes/model/EventConfig_model.php b/includes/model/EventConfig_model.php
index 646d19c5..766a5849 100644
--- a/includes/model/EventConfig_model.php
+++ b/includes/model/EventConfig_model.php
@@ -9,7 +9,9 @@ use Engelsystem\Database\DB;
*/
function EventConfig()
{
- return DB::selectOne('SELECT * FROM `EventConfig` LIMIT 1');
+ $config = DB::selectOne('SELECT * FROM `EventConfig` LIMIT 1');
+
+ return empty($config) ? null : $config;
}
/**
@@ -21,7 +23,7 @@ function EventConfig()
* @param int $event_end_date
* @param int $teardown_end_date
* @param string $event_welcome_msg
- * @return int Rows updated
+ * @return bool
*/
function EventConfig_update(
$event_name,
@@ -31,7 +33,8 @@ function EventConfig_update(
$teardown_end_date,
$event_welcome_msg
) {
- if (EventConfig() == null) {
+ $eventConfig = EventConfig();
+ if (empty($eventConfig)) {
return DB::insert('
INSERT INTO `EventConfig` (
`event_name`,
@@ -54,7 +57,7 @@ function EventConfig_update(
);
}
- return DB::update('
+ return (bool)DB::update('
UPDATE `EventConfig` SET
`event_name` = ?,
`buildup_start_date` = ?,