Skip to content
Snippets Groups Projects
Select Git revision
  • d11396f3db18726943a12ae32616645ee5915138
  • main default protected
  • step-3263
  • feature/plugins-cli
  • feature/vite
  • step-2484-peerreview
  • biest/issue-5051
  • tests/simplify-jsonapi-tests
  • fix/typo-in-1a70031
  • feature/broadcasting
  • database-seeders-and-factories
  • feature/peer-review-2
  • feature-feedback-jsonapi
  • feature/peerreview
  • feature/balloon-plus
  • feature/stock-images-unsplash
  • tic-2588
  • 5.0
  • 5.2
  • biest/unlock-blocks
  • biest-1514
21 results

StudipAuthSSO.class.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.
    StudipStudyArea.php 15.02 KiB
    <?php
    /**
     * Studienbereich... TODO
     *
     * Copyright (C) 2008 - Marcus Lunzenauer <mlunzena@uos.de>
     *
     * 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.
     *
     * @package     studip
     *
     * @author    mlunzena
     * @author    André Noack <noack@data-quest.de>
     * @copyright (c) Authors
     *
     * @property string $id alias column for sem_tree_id
     * @property string $sem_tree_id database column
     * @property string $parent_id database column
     * @property int $priority database column
     * @property string $info database column
     * @property string $name database column
     * @property string|null $studip_object_id database column
     * @property int $type database column
     * @property int|null $mkdate database column
     * @property int|null $chdate database column
     * @property SimpleORMapCollection|StudipStudyArea[] $_children has_many StudipStudyArea
     * @property StudipStudyArea $_parent belongs_to StudipStudyArea
     * @property SimpleORMapCollection|Course[] $courses has_and_belongs_to_many Course
     */
    
    class StudipStudyArea extends SimpleORMap implements StudipTreeNode
    {
        use StudipTreeNodeCachableTrait;
        use StudipTreeNodeCourseTrait;
    
        /**
         * This constant represents the key of the root area.
         */
        const ROOT = 'root';
    
        protected static function configure($config = [])
        {
            $config['db_table'] = 'sem_tree';
            $config['has_many']['_children'] = [
                'class_name' => StudipStudyArea::class,
                'assoc_foreign_key' => 'parent_id',
                'assoc_func' => 'findByParent',
                'on_delete' => 'delete',
                'on_store' => 'store',
            ];
            $config['has_and_belongs_to_many']['courses'] = [
                'class_name' => Course::class,
                'thru_table' => 'seminar_sem_tree',
            ];
            $config['belongs_to']['_parent'] = [
                'class_name' => StudipStudyArea::class,
                'foreign_key' => 'parent_id',
            ];
    
            $config = self::registerCachableCallbacks($config);
    
            parent::configure($config);
        }
    
        /**
         * This is required, if the nodes are added backwards
         */
        public $required_children = [];