Select Git revision
myplugins.php
-
Jan-Hendrik Willms authoredJan-Hendrik Willms authored
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
StructuralElement.php 39.60 KiB
<?php
namespace Courseware;
use JSONArrayObject;
use User;
/**
* Courseware's structural elements.
*
* @author Marcus Eibrink-Lunzenauer <lunzenauer@elan-ev.de>
* @author Till Glöggler <gloeggler@elan-ev.de>
* @author Ron Lucke <lucke@elan-ev.de>
* @license GPL2 or any later version
*
* @since Stud.IP 5.0
*
* @property int $id database column
* @property int|null $parent_id database column
* @property int $is_link database column
* @property int|null $target_id database column
* @property string $range_id database column
* @property string|null $range_type database column
* @property string $owner_id database column
* @property string $editor_id database column
* @property string|null $edit_blocker_id database column
* @property int $position database column
* @property string $title database column
* @property string|null $image_id database column
* @property string $image_type database column
* @property string|null $purpose database column
* @property \JSONArrayObject $payload database column
* @property int $public database column
* @property int $commentable database column
* @property int $release_date database column
* @property int $withdraw_date database column
* @property \JSONArrayObject $read_approval database column
* @property \JSONArrayObject $write_approval database column
* @property \JSONArrayObject $copy_approval database column
* @property \JSONArrayObject $external_relations database column
* @property int $mkdate database column
* @property int $chdate database column
* @property \SimpleORMapCollection|StructuralElement[] $children has_many StructuralElement
* @property \SimpleORMapCollection|Container[] $containers has_many Container
* @property \SimpleORMapCollection|StructuralElementComment[] $comments has_many StructuralElementComment
* @property \SimpleORMapCollection|StructuralElementFeedback[] $feedback has_many StructuralElementFeedback
* @property StructuralElement|null $parent belongs_to StructuralElement
* @property \User $user belongs_to \User
* @property \Course $course belongs_to \Course
* @property \User $owner belongs_to \User
* @property \User $editor belongs_to \User
* @property \User|null $edit_blocker belongs_to \User
* @property Task $task has_one Task
* @property mixed $image additional field
*/
class StructuralElement extends \SimpleORMap implements \PrivacyObject, \FeedbackRange
{
protected static function configure($config = [])
{
$config['db_table'] = 'cw_structural_elements';
$config['serialized_fields']['payload'] = JSONArrayObject::class;
$config['serialized_fields']['read_approval'] = JSONArrayObject::class;
$config['serialized_fields']['write_approval'] = JSONArrayObject::class;
$config['serialized_fields']['copy_approval'] = JSONArrayObject::class;
$config['serialized_fields']['external_relations'] = JSONArrayObject::class;
$config['has_many']['children'] = [
'class_name' => StructuralElement::class,
'assoc_foreign_key' => 'parent_id',