Select Git revision
StudipAuthSSO.class.php
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 = [];