From 39720864ac849ed5e8fe03602109ac73a27f0c46 Mon Sep 17 00:00:00 2001 From: hhunderter Date: Mon, 3 Feb 2020 23:36:15 +0100 Subject: [PATCH] Some Beauty fixes --- config/config.php | 6 +++++- mappers/HoererCharts.php | 10 ++++++---- mappers/HoererChartsSuggestion.php | 1 + mappers/HoererChartsUserVotes.php | 10 ++++++---- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/config/config.php b/config/config.php index fad5ae1..26deb55 100644 --- a/config/config.php +++ b/config/config.php @@ -10,7 +10,7 @@ class Config extends \Ilch\Config\Install { public $config = [ 'key' => 'radiohoerercharts', - 'version' => '1.4.2', + 'version' => '1.4.3', 'icon_small' => 'fa-list-ol', 'author' => 'Reilard, Dennis alias hhunderter ', 'link' => '', @@ -188,6 +188,10 @@ public function getUpdate($installedVersion) bugfix of SQL-Statement is_voted Some Beauty fixes */ + case "1.4.2": //update zu 1.4.3 + /* + Some Beauty fixes + */ case "1.4.2": //update zu ? } return 'Update function executed.'; diff --git a/mappers/HoererCharts.php b/mappers/HoererCharts.php index b5bd2bf..7da0e02 100644 --- a/mappers/HoererCharts.php +++ b/mappers/HoererCharts.php @@ -14,6 +14,7 @@ class HoererCharts extends \Ilch\Mapper * returns if the module is installed. * * @return boolean + * @throws \Ilch\Database\Exception */ public function checkDB() { @@ -252,8 +253,9 @@ public function delete($id) */ public function reset() { - $sql = 'UPDATE `[prefix]_radio_hoerercharts` SET votes=0;'; - return $this->db()->queryMulti($sql); + return $this->db()->update('radio_hoerercharts') + ->values(['votes' => 0]) + ->execute(); } /** @@ -283,8 +285,8 @@ public function getStars($votes = 0, $config = null, $showstars = false) /** * Checks if voting is allowed. * - * @param string $start_datetime - * @param string $end_datetime + * @param null|\Ilch\Date $start_datetime + * @param null|\Ilch\Date $end_datetime * @return boolean */ public function vote_allowed($start_datetime = null, $end_datetime = null) diff --git a/mappers/HoererChartsSuggestion.php b/mappers/HoererChartsSuggestion.php index 6c90c0c..b88380d 100644 --- a/mappers/HoererChartsSuggestion.php +++ b/mappers/HoererChartsSuggestion.php @@ -14,6 +14,7 @@ class HoererChartsSuggestion extends \Ilch\Mapper * returns if the module is installed. * * @return boolean + * @throws \Ilch\Database\Exception */ public function checkDB() { diff --git a/mappers/HoererChartsUserVotes.php b/mappers/HoererChartsUserVotes.php index d7bbe33..25a265a 100644 --- a/mappers/HoererChartsUserVotes.php +++ b/mappers/HoererChartsUserVotes.php @@ -166,12 +166,12 @@ public function delete_session($session_id) ->where(['session_id' => $session_id]) ->execute(); } - + /** * Gets the entry by given ID. * - * @param int $id - * @return null|EntriesModel + * @param \Modules\User\Models\User $User + * @return integer */ public function getEntryByUserSession($User = null) { @@ -205,8 +205,9 @@ public function getEntryByUserSession($User = null) /** * Check if user has already voted or if guests can vote. * - * @param \Ilch\User $User + * @param \Modules\User\Models\User $User * @param boolean $guestallow + * @param integer $timediff * @return boolean */ public function is_voted($User = null, $guestallow = false, $timediff = 30) @@ -256,6 +257,7 @@ public function is_voted($User = null, $guestallow = false, $timediff = 30) * Reset the Vote counts. * * @return boolean + * @throws \Ilch\Database\Exception */ public function reset() {