diff --git a/lib/classes/SimpleORMap.php b/lib/classes/SimpleORMap.php index 46ea70dd57464988af06097cd1c1968d8c5634a7..3823143a824c9b5bd6babb2583ec27781788ca7c 100644 --- a/lib/classes/SimpleORMap.php +++ b/lib/classes/SimpleORMap.php @@ -1543,7 +1543,7 @@ class SimpleORMap implements ArrayAccess, Countable, IteratorAggregate } else { $ret = ($this->content[$field] = $value); } - } elseif (isset($this->additional_fields()[$field]['set'])) { + } elseif (!empty($this->additional_fields()[$field]['set'])) { if ($this->additional_fields()[$field]['set'] instanceof Closure) { return call_user_func_array($this->additional_fields()[$field]['set'], [$this, $field, $value]); } else { diff --git a/lib/models/Courseware/Block.php b/lib/models/Courseware/Block.php index 8b3d6f43349dd8c3118f993858f12eedec26e6c0..a3d7f09a30af212fd7e059ff5b3690c0ea246ba1 100644 --- a/lib/models/Courseware/Block.php +++ b/lib/models/Courseware/Block.php @@ -99,7 +99,6 @@ class Block extends \SimpleORMap implements \PrivacyObject 'get' => function ($block) { return BlockTypes\BlockType::factory($block); }, - 'set' => false, ]; $config['additional_fields']['files'] = [ @@ -285,6 +284,6 @@ class Block extends \SimpleORMap implements \PrivacyObject if ($blocks) { $storage->addTabularData(_('Courseware Blöcke'), 'cw_blocks', $blocks); } - + } } diff --git a/lib/models/Courseware/Container.php b/lib/models/Courseware/Container.php index a4f773fa9cc43e2c87561260dcbf74f13646d753..5e4a49a47c08b1e89b401aba06454e0f55f3b4e6 100644 --- a/lib/models/Courseware/Container.php +++ b/lib/models/Courseware/Container.php @@ -73,7 +73,6 @@ class Container extends \SimpleORMap implements \PrivacyObject 'get' => function ($container) { return ContainerTypes\ContainerType::factory($container); }, - 'set' => false, ]; parent::configure($config); @@ -184,7 +183,7 @@ class Container extends \SimpleORMap implements \PrivacyObject if ($containers) { $storage->addTabularData(_('Courseware Abschnitte'), 'cw_containers', $containers); } - + } public static function createFromData(User $user, $data, StructuralElement $element): Container diff --git a/lib/models/Courseware/Task.php b/lib/models/Courseware/Task.php index 2a1a28d2b00b20321d20fb3ceda9c45b43493a35..7842830050d45156180786e19eba5b9653c2e28f 100644 --- a/lib/models/Courseware/Task.php +++ b/lib/models/Courseware/Task.php @@ -81,11 +81,9 @@ class Task extends \SimpleORMap $config['additional_fields']['solver'] = [ 'get' => 'getSolver', - 'set' => false, ]; $config['additional_fields']['submission_date'] = [ 'get' => 'getSubmissionDate', - 'set' => false, ]; parent::configure($config); diff --git a/lib/models/DataField.php b/lib/models/DataField.php index 8a0bdb68e4052dd1a4e8d82711f49f403e905767..1a83804d46f1cb2f523f57c6c74e68d774705f84 100644 --- a/lib/models/DataField.php +++ b/lib/models/DataField.php @@ -62,7 +62,6 @@ class DataField extends SimpleORMap implements PrivacyObject } return $institution; }, - 'set' => false, ); $config['i18n_fields']['name'] = true; diff --git a/lib/models/Fach.php b/lib/models/Fach.php index 24a1a6c50763694cf26f8101b911ecb34c727ccf..aff81beb0b5ddfdc7a4c887cadc4ffcb3361f50f 100644 --- a/lib/models/Fach.php +++ b/lib/models/Fach.php @@ -71,20 +71,21 @@ class Fach extends ModuleManagementModelTreeItem implements PrivacyObject '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['additional_fields']['count_abschluesse']['get'] = function ($fach) { + return $fach->count_abschluesse; + }; + $config['additional_fields']['count_user']['get'] = function ($fach) { + return $fach->count_user; + }; + $config['additional_fields']['count_sem']['get'] = function ($fach) { + return $fach->count_sem; + }; + $config['additional_fields']['count_stgteile']['get'] = function ($fach) { + return $fach->count_stgteile; + }; + $config['additional_fields']['count_module']['get'] = function ($fach) { + return $fach->count_module; + }; $config['i18n_fields']['name'] = true; $config['i18n_fields']['name_kurz'] = true; diff --git a/lib/models/Lvgruppe.php b/lib/models/Lvgruppe.php index bdd9f0b7a83eca52839f03aaecf6047dc29b018a..19fc373b0f4c57d0a38ff7a7f1b1b30f1b19683b 100644 --- a/lib/models/Lvgruppe.php +++ b/lib/models/Lvgruppe.php @@ -55,18 +55,18 @@ class Lvgruppe extends ModuleManagementModelTreeItem 'on_store' => 'store' ]; - $config['additional_fields']['count_seminare']['get'] = - function($lvgruppe) { return $lvgruppe->count_seminare; }; - $config['additional_fields']['count_seminare']['set'] = false; - $config['additional_fields']['count_archiv']['get'] = - function($lvgruppe) { return $lvgruppe->count_archiv; }; - $config['additional_fields']['count_archiv']['set'] = false; - $config['additional_fields']['count_modulteile']['get'] = - function($lvgruppe) { return $lvgruppe->count_modulteile; }; - $config['additional_fields']['count_modulteile']['set'] = false; - $config['additional_fields']['count_semester']['get'] = - function($lvgruppe) { return $lvgruppe->count_semester; }; - $config['additional_fields']['count_semester']['set'] = false; + $config['additional_fields']['count_seminare']['get'] = function ($lvgruppe) { + return $lvgruppe->count_seminare; + }; + $config['additional_fields']['count_archiv']['get'] = function ($lvgruppe) { + return $lvgruppe->count_archiv; + }; + $config['additional_fields']['count_modulteile']['get'] = function ($lvgruppe) { + return $lvgruppe->count_modulteile; + }; + $config['additional_fields']['count_semester']['get'] = function ($lvgruppe) { + return $lvgruppe->count_semester; + }; $config['i18n_fields']['alttext'] = true; diff --git a/lib/models/Modul.php b/lib/models/Modul.php index 1d0ca3353d44e2048dcfb08e354a4d6daab24df0..31f4bbec7f0f775d296d3862dcec2598f550de66 100644 --- a/lib/models/Modul.php +++ b/lib/models/Modul.php @@ -140,14 +140,15 @@ class Modul extends ModuleManagementModelTreeItem 'on_store' => 'store' ]; - $config['additional_fields']['count_modulteile']['get'] = - function ($modul) { return $modul->count_modulteile; }; - $config['additional_fields']['count_modulteile']['set'] = false; - $config['additional_fields']['languagesofinstruction']['get'] = - function ($modul) { return $modul->languages; }; - $config['additional_fields']['languagesofinstruction']['set'] = false; - $config['additional_fields']['display_name']['get'] = - function ($modul) { return $modul->getDisplayName(); }; + $config['additional_fields']['count_modulteile']['get'] = function ($modul) { + return $modul->count_modulteile; + }; + $config['additional_fields']['languagesofinstruction']['get'] = function ($modul) { + return $modul->languages; + }; + $config['additional_fields']['display_name']['get'] = function ($modul) { + return $modul->getDisplayName(); + }; $config['alias_fields']['flexnow_id'] = 'flexnow_modul'; diff --git a/lib/models/Modulteil.php b/lib/models/Modulteil.php index 089246bf48767ddb5563de0601c0d1e00f9df5cc..397fc18de55063d93e3119d6088cac72e4bcefea 100644 --- a/lib/models/Modulteil.php +++ b/lib/models/Modulteil.php @@ -103,7 +103,6 @@ class Modulteil extends ModuleManagementModelTreeItem $config['additional_fields']['count_lvgruppen']['get'] = function ($mt) { return $mt->count_lvgruppen; }; - $config['additional_fields']['count_lvgruppen']['set'] = false; parent::configure($config); } diff --git a/lib/models/Semester.php b/lib/models/Semester.php index ca75dd2d370e12b3f79ee0184fde65a0f852d276..afd7b08051bcd2e0bb2a6e75a5f66b0bbed46b51 100644 --- a/lib/models/Semester.php +++ b/lib/models/Semester.php @@ -56,11 +56,9 @@ class Semester extends SimpleORMap $config['additional_fields']['absolute_seminars_count'] = [ 'get' => 'seminarCounter', - 'set' => false, ]; $config['additional_fields']['continuous_seminars_count'] = [ 'get' => 'seminarCounter', - 'set' => false, ]; $config['alias_fields']['token'] = 'semester_token'; diff --git a/lib/models/StgteilAbschnitt.php b/lib/models/StgteilAbschnitt.php index 75a6cc8a58375110f20413ffb382d5dc501a5d09..77f8aef001d3c2a826ba323d0b6726341fd5fd45 100644 --- a/lib/models/StgteilAbschnitt.php +++ b/lib/models/StgteilAbschnitt.php @@ -65,9 +65,9 @@ class StgteilAbschnitt extends ModuleManagementModelTreeItem 'on_store' => 'store' ]; - $config['additional_fields']['count_module']['get'] = - function($fach) { return $fach->count_module; }; - $config['additional_fields']['count_module']['set'] = false; + $config['additional_fields']['count_module']['get'] = function ($fach) { + return $fach->count_module; + }; $config['i18n_fields']['name'] = true; $config['i18n_fields']['kommentar'] = true; diff --git a/lib/models/StgteilBezeichnung.php b/lib/models/StgteilBezeichnung.php index ba6ddd9053ccf550432c61895b79f03ca6868110..58eea27e66f15ea136be987e9cc49dea5439a2f5 100644 --- a/lib/models/StgteilBezeichnung.php +++ b/lib/models/StgteilBezeichnung.php @@ -32,12 +32,12 @@ class StgteilBezeichnung extends ModuleManagementModel { $config['db_table'] = 'mvv_stgteil_bez'; - $config['additional_fields']['count_stgteile']['get'] = - function($stg_bez) { return $stg_bez->count_stgteile; }; - $config['additional_fields']['count_stgteile']['set'] = false; - $config['additional_fields']['count_studiengaenge']['get'] = - function($stg_bez) { return $stg_bez->count_studiengaenge; }; - $config['additional_fields']['count_studiengaenge']['set'] = false; + $config['additional_fields']['count_stgteile']['get'] = function ($stg_bez) { + return $stg_bez->count_stgteile; + }; + $config['additional_fields']['count_studiengaenge']['get'] = function ($stg_bez) { + return $stg_bez->count_studiengaenge; + }; $config['i18n_fields']['name'] = true; $config['i18n_fields']['name_kurz'] = true;