aboutsummaryrefslogtreecommitdiff
path: root/lib/models/NewsRange.class.php
diff options
context:
space:
mode:
authorPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2024-09-24 10:53:31 +0200
committerPhilipp Schüttlöffel <schuettloeffel@zqs.uni-hannover.de>2024-09-24 10:53:31 +0200
commit4459dd7917f4d1c34f40bb68f0e991e9c3d53e4c (patch)
tree5c07151ae61276d334e88f6309c30d439a85c12e /lib/models/NewsRange.class.php
parentda0022e5c1abbf9825ae76debaabdff7e8623bb4 (diff)
parent97a188592c679890a25c37ab78463add76a52ff7 (diff)
Merge branch 'main' into issue-3911issue-3911
Diffstat (limited to 'lib/models/NewsRange.class.php')
-rw-r--r--lib/models/NewsRange.class.php71
1 files changed, 0 insertions, 71 deletions
diff --git a/lib/models/NewsRange.class.php b/lib/models/NewsRange.class.php
deleted file mode 100644
index 7785214..0000000
--- a/lib/models/NewsRange.class.php
+++ /dev/null
@@ -1,71 +0,0 @@
-<?php
-/**
- * NewsRange.class.php - model class for table Institute
- *
- * 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 (at your option) any later version.
- *
- * @author André Noack <noack@data-quest.de>
- * @copyright 2012 Stud.IP Core-Group
- * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
- * @category Stud.IP
- *
- * @property array $id alias for pk
- * @property string $news_id database column
- * @property string $range_id database column
- * @property int|null $mkdate database column
- * @property int|null $chdate database column
- * @property User $user belongs_to User
- * @property Course $course belongs_to Course
- * @property Institute $institute belongs_to Institute
- * @property mixed $type additional field
- * @property mixed $name additional field
- */
-class NewsRange extends SimpleORMap
-{
- protected static function configure($config = [])
- {
- $config['db_table'] = 'news_range';
- $config['belongs_to']['user'] = [
- 'class_name' => User::class,
- 'foreign_key' => 'range_id',
- ];
- $config['belongs_to']['course'] = [
- 'class_name' => Course::class,
- 'foreign_key' => 'range_id',
- ];
- $config['belongs_to']['institute'] = [
- 'class_name' => Institute::class,
- 'foreign_key' => 'range_id',
- ];
- $config['additional_fields']['type'] = true;
- $config['additional_fields']['name'] = true;
- parent::configure($config);
- }
-
- function getType()
- {
- return get_object_type($this->range_id, ['sem','inst','user','fak']);
- }
-
- function getName()
- {
- switch ($this->type) {
- case 'global':
- return _('Stud.IP-Startseite');
- break;
- case 'sem':
- return $this->course->name;
- break;
- case 'user':
- return $this->user->getFullName();
- break;
- case 'inst':
- case 'fak':
- return $this->institute->name;
- break;
- }
- }
-}