diff options
| author | Jan-Hendrik Willms <tleilax+github@gmail.com> | 2021-07-22 16:07:19 +0200 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+github@gmail.com> | 2021-07-22 16:19:12 +0200 |
| commit | a3da1483a9e689846179159355badfec8073dbec (patch) | |
| tree | 770dcca6bdf5f6f2a11b0e7fcbbeda6919a3fc52 /lib/models/AdmissionRuleCompatibility.php | |
current code from svn, revision 62608
Diffstat (limited to 'lib/models/AdmissionRuleCompatibility.php')
| -rw-r--r-- | lib/models/AdmissionRuleCompatibility.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/models/AdmissionRuleCompatibility.php b/lib/models/AdmissionRuleCompatibility.php new file mode 100644 index 0000000..f3447bc --- /dev/null +++ b/lib/models/AdmissionRuleCompatibility.php @@ -0,0 +1,47 @@ +<?php +/** + * AdmissionRuleCompatibility.php + * model class for table admissionrule_compat + * + * 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 Thomas Hackl <thomas.hackl@uni-passau.de> + * @copyright 2016 Stud.IP Core-Group + * @license http://www.gnu.org/licenses/gpl-2.0.html GPL version 2 + * @category Stud.IP + * @since 3.5 + * + * @property string rule_type database column + * @property string compat_rule_type database column + * @property int mkdate database column + * @property int chdate database column + */ +class AdmissionRuleCompatibility extends SimpleORMap +{ + + protected static function configure($config = []) + { + $config['db_table'] = 'admissionrule_compat'; + parent::configure($config); + } + + public static function getCompatibilityMatrix() + { + $types = AdmissionRule::getAvailableAdmissionRules(false); + + $matrix = []; + foreach ($types as $class => $data) { + $compat = self::findByRule_type($class); + + foreach ($compat as $c) { + $matrix[$class][] = $c->compat_rule_type; + } + } + + return $matrix; + } + +} |
