Skip to content
Snippets Groups Projects
Select Git revision
  • 7adf8a42ee401608f39070c5c642bdaed9e08e4b
  • main default protected
  • studip-rector
  • ci-opt
  • course-members-export-as-word
  • data-vue-app
  • pipeline-improvements
  • webpack-optimizations
  • rector
  • icon-renewal
  • http-client-and-factories
  • jsonapi-atomic-operations
  • vueify-messages
  • tic-2341
  • 135-translatable-study-areas
  • extensible-sorm-action-parameters
  • sorm-configuration-trait
  • jsonapi-mvv-routes
  • docblocks-for-magic-methods
19 results

Statusgruppen.php

Blame
  • Forked from Stud.IP / Stud.IP
    Source project has a limited visibility.
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    Fach.php 27.92 KiB
    <?php
    /**
     * Fach.php
     * Model class for Faecher (table fach)
     *
     * 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      Peter Thienel <thienel@data-quest.de>
     * @license     http://www.gnu.org/licenses/gpl-2.0.html GPL version 2
     * @category    Stud.IP
     * @since       3.5
     */
    
    class Fach extends ModuleManagementModelTreeItem implements PrivacyObject
    {
        protected static function configure($config = [])
        {
            $config['db_table'] = 'fach';
    
            $config['has_many']['abschluesse'] = [
                'class_name' => Abschluss::class,
                'assoc_func' => 'findByFach'
            ];
            $config['has_many']['studiengangteile'] = [
                'class_name' => StudiengangTeil::class,
                'assoc_foreign_key' => 'fach_id'
            ];
            $config['has_and_belongs_to_many']['departments'] = [
                'class_name' => Fachbereich::class,
                'thru_table' => 'mvv_fach_inst',
                'thru_key' => 'fach_id',
                'thru_assoc_key' => 'institut_id',
                'order_by' => 'ORDER BY position'
            ];
            $config['has_and_belongs_to_many']['degrees'] = [
                'class_name' => Abschluss::class,
                'thru_table' => 'user_studiengang',
                'thru_key' => 'fach_id',
                'thru_assoc_key' => 'abschluss_id',
                'order_by' => 'GROUP BY abschluss_id ORDER BY name'
            ];
            $config['has_many']['department_assignments'] = [
                'class_name' => FachFachbereich::class,
                'assoc_foreign_key' => 'fach_id',
                'order_by' => 'ORDER BY position',
                'on_store' => 'store',
                'on_delete' => 'delete'
            ];
    
            $config['additional_fields']['count_abschluesse']['get'] =
                function($fach) { return $fach->count_abschluesse; };
            $config['additional_fields']['count_abschluesse']['set'] = false;
            $config['additional_fields']['count_user']['get'] =
                function($fach) { return $fach->count_user; };
            $config['additional_fields']['count_user']['set'] = false;
            $config['additional_fields']['count_sem']['get'] =
                function($fach) { return $fach->count_sem; };
            $config['additional_fields']['count_sem']['set'] = false;
            $config['additional_fields']['count_stgteile']['get'] =
                function($fach) { return $fach->count_stgteile; };
            $config['additional_fields']['count_stgteile']['set'] = false;
            $config['additional_fields']['count_module']['get'] =
                function($fach) { return $fach->count_module; };
    
            $config['i18n_fields']['name'] = true;
            $config['i18n_fields']['name_kurz'] = true;
            $config['i18n_fields']['beschreibung'] = true;