diff options
| author | Philipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de> | 2024-09-24 10:53:31 +0200 |
|---|---|---|
| committer | Philipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de> | 2024-09-24 10:53:31 +0200 |
| commit | 4459dd7917f4d1c34f40bb68f0e991e9c3d53e4c (patch) | |
| tree | 5c07151ae61276d334e88f6309c30d439a85c12e /lib/raumzeit/MetaDateDB.php | |
| parent | da0022e5c1abbf9825ae76debaabdff7e8623bb4 (diff) | |
| parent | 97a188592c679890a25c37ab78463add76a52ff7 (diff) | |
Merge branch 'main' into issue-3911issue-3911
Diffstat (limited to 'lib/raumzeit/MetaDateDB.php')
| -rw-r--r-- | lib/raumzeit/MetaDateDB.php | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/lib/raumzeit/MetaDateDB.php b/lib/raumzeit/MetaDateDB.php new file mode 100644 index 0000000..29af00e --- /dev/null +++ b/lib/raumzeit/MetaDateDB.php @@ -0,0 +1,55 @@ +<?php +# Lifter002: DONE - not applicable +# Lifter007: TEST +# Lifter003: TEST +# Lifter010: DONE - not applicable + +// +--------------------------------------------------------------------------+ +// This file is part of Stud.IP +// MetaDateDB.php +// +// Datenbank-Abfragen für MetaDate.php +// +// +--------------------------------------------------------------------------+ +// This program is free software; you can redistribute it and/or +// modify it under the terms of the GNU General Public License +// as published by the Free Software Foundation; either version 2 +// of the License, or any later version. +// +--------------------------------------------------------------------------+ +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// You should have received a copy of the GNU General Public License +// along with this program; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +// +--------------------------------------------------------------------------+ + + +/** + * MetaDateDB.php + * + * + * @author Till Glöggler <tgloeggl@uos.de> + * @version 19. Oktober 2005 + * @access protected + * @package raumzeit + */ +class MetaDateDB +{ + public static function has_dates($metadate_id, $seminar_id, $filterStart = 0, $filterEnd = 0) + { + $query = "SELECT 1 FROM termine WHERE range_id = ? AND metadate_id = ?"; + $parameters = [$seminar_id, $metadate_id]; + + if ($filterStart != 0) { + $query .= " AND date >= ? AND end_time <= ?"; + array_push($parameters, $filterStart, $filterEnd); + } + + $statement = DBManager::get()->prepare($query); + $statement->execute($parameters); + + return (bool)$statement->fetchColumn(); + } +} |
