Stud.IP  trunk Revision
Modul Class Reference
Inheritance diagram for Modul:
Inheritance graph
Collaboration diagram for Modul:
Collaboration graph

Public Member Functions

 __construct ($id=null)
 
 getTrailParentId ()
 
 getTrailParent ()
 
 getChildren ()
 
 hasChildren ()
 
 getParents ($mode=null)
 
 getDisplayName ($options=self::DISPLAY_DEFAULT)
 
 getDisplaySemesterValidity ()
 
 getDefaultLanguage ()
 
 getDeskriptor ($language=null, $force_new=false)
 
 assignResponsibleInstitute ($institut_id)
 
 assignInstitutes ($institut_ids)
 
 assignUsers ($grouped_user_ids)
 
 getGroupedAssignedUsers ()
 
 assignLanguagesOfInstruction ($languages)
 
 getResponsibleInstitutes ()
 
 copy ($deep=true, $with_assignments=false)
 
 getVariants ()
 
 validate ()
 
 getAssignedCoursesBySemester ($semester_id, $only_visible=true)
 
- Public Member Functions inherited from ModuleManagementModelTreeItem
 getTrailParentId ()
 
 getTrails ($types=null, $mode=null, $path=null, $in_recursion=false)
 
 isAssignable ()
 
 hasChildren ()
 
- Public Member Functions inherited from ModuleManagementModel
 verifyPermission ($user_id=null)
 
 store ()
 
 validate ()
 
 delete ()
 
 setNewId ()
 
 getDisplayName ($options=self::DISPLAY_DEFAULT)
 
 getAvailableTranslations ()
 
 getStatus ()
 
 hasPublicStatus ($filter=null)
 
 getResponsibleInstitutes ()
 
 getVariant ()
 
- Public Member Functions inherited from SimpleORMap
 __construct ($id=null)
 
 __clone ()
 
 getRelationOptions ($relation)
 
 getTableMetadata ()
 
 hasAutoIncrementColumn ()
 
 setId ($id)
 
 getId ()
 
 getNewId ()
 
 toArray ($only_these_fields=null)
 
 toRawArray ($only_these_fields=null)
 
 toArrayRecursive ($only_these_fields=null)
 
 getValue ($field)
 
 getRelationValue ($relation, $field)
 
 getDefaultValue ($field)
 
 setValue ($field, $value)
 
 __get ($field)
 
 __set ($field, $value)
 
 __isset ($field)
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 getIterator ()
 
 count ()
 
 isField ($field)
 
 isAdditionalField ($field)
 
 isAliasField ($field)
 
 isI18nField ($field)
 
 setData ($data, $reset=false)
 
 isNew ()
 
 isDeleted ()
 
 setNew ($is_new)
 
 getWhereQuery ()
 
 restore ()
 
 store ()
 
 triggerChdate ()
 
 delete ()
 
 isDirty ()
 
 isFieldDirty ($field)
 
 revertValue ($field)
 
 getPristineValue ($field)
 
 initRelation ($relation)
 
 resetRelation ($relation)
 
 cleanup ()
 

Static Public Member Functions

static getClassDisplayName ($long=false)
 
static getEnriched ($modul_id)
 
static getAllEnriched ($sortby='chdate', $order='ASC', $row_count=null, $offset=null, $filter=null)
 
static getCount ($filter=null)
 
static findBySearchTerm ($term, $filter=null)
 
static findByStgteilAbschnitt ($abschnitt_id, $filter)
 
static findByInstitut ($sortby='chdate', $order='ASC', $filter=[], $row_count=null, $offset=null)
 
static findByLvgruppe ($lvgruppe_id)
 
static getAssignedInstitutes ($sortby='name', $order='ASC', $modul_ids=[])
 
static getAllAssignedInstitutes ($sortby='name', $order='ASC', $filter=null, $row_count=null, $offset=null)
 
static findStatusByIds ($modul_ids=null)
 
static findByFilter ($filter)
 
static search ($search_term, $only_public=true)
 
static publicModulesAvailable ()
 
- Static Public Member Functions inherited from ModuleManagementModelTreeItem
static getPathes ($trails, $delimiter=' · ', $display_options=self::DISPLAY_DEFAULT)
 
static filterTrails ($trails, $filter_objects)
 
static setObjectFilter ($class_name, $filter_func)
 
- Static Public Member Functions inherited from ModuleManagementModel
static findBySearchTerm ($search_term, $filter=null)
 
static getAll ()
 
static get ($id=null)
 
static getEnriched ($id)
 
static getEnrichedByQuery ($query=null, $params=[], $row_count=null, $offset=null)
 
static getClassDisplayName ($long=false)
 
static getFilterSql ($filter, $where=false, $or_sql=null)
 
static getContentArray (SimpleORMap $sorm, $to_utf8=true)
 
static getCount ($filter=null)
 
static getCountBySql ($sql, $filter=null)
 
static setLanguage ($language)
 
static setContentLanguage ($language)
 
static getLanguage ()
 
static getLocaleOrdinalNumberSuffix ($num)
 
static getPublicStatus ($class_name=null)
 
- Static Public Member Functions inherited from SimpleORMap
static tableScheme ($db_table)
 
static expireTableScheme ()
 
static find ($id)
 
static exists ($id)
 
static countBySql ($sql=1, $params=[])
 
static create ($data)
 
static build ($data, $is_new=true)
 
static buildExisting ($data)
 
static import ($data)
 
static findBySQL ($sql, $params=[])
 
static findOneBySQL ($where, $params=[])
 
static findThru ($foreign_key_value, $options)
 
static findEachBySQL ($callable, $sql, $params=[])
 
static findMany ($pks=[], $order='', $order_params=[])
 
static findEachMany ($callable, $pks=[], $order='', $order_params=[])
 
static findAndMapBySQL ($callable, $where, $params=[])
 
static findAndMapMany ($callable, $pks=[], $order='', $order_params=[])
 
static deleteBySQL ($where, $params=[])
 
static toObject ($id_or_object)
 
static __callStatic ($name, $arguments)
 

Static Protected Member Functions

static configure ($config=[])
 
- Static Protected Member Functions inherited from ModuleManagementModelTreeItem
static sortTrails ($trail_a, $trail_b)
 
- Static Protected Member Functions inherited from ModuleManagementModel
static checkSortFields ($sort, $standard_field=null, $additional_fields=[])
 
static createSortStatement ($sort, $order='ASC', $standard_field=null, $additional_fields=[])
 
- Static Protected Member Functions inherited from SimpleORMap
static configure ($config=[])
 
static config ($key)
 

Additional Inherited Members

- Data Fields inherited from ModuleManagementModel
const DISPLAY_DEFAULT = 1
 
const DISPLAY_SEMESTER = 2
 
const DISPLAY_CODE = 4
 
const DISPLAY_FACULTY = 8
 
const DISPLAY_FACH = 16
 
const DISPLAY_STGTEIL = 32
 
const DISPLAY_ABSCHLUSS = 64
 
const DISPLAY_KATEGORIE = 128
 
 $object_real_name = ''
 
- Data Fields inherited from SimpleORMap
const ID_SEPARATOR = '_'
 
- Static Public Attributes inherited from ModuleManagementModelTreeItem
static $TRAIL_DEFAULT
 
- Static Public Attributes inherited from SimpleORMap
static $schemes = null
 
- Protected Member Functions inherited from ModuleManagementModel
 logChanges ($action=null)
 
- Protected Member Functions inherited from SimpleORMap
 _getId ($field)
 
 _setId ($field, $value)
 
 _getAdditionalValueFromRelation ($field)
 
 _setAdditionalValueFromRelation ($field, $value)
 
 _getAdditionalValue ($field)
 
 _setAdditionalValue ($field, $value)
 
 parseRelationOptions ($type, $name, $options)
 
 storeRelations ($only_these=null)
 
 deleteRelations ()
 
 initializeContent ()
 
 applyCallbacks ($type)
 
 registerCallback ($types, $cb)
 
 unregisterCallback ($types, $cb)
 
 cbAutoIncrementColumn ($type)
 
 cbAutoKeyCreation ()
 
 cbNotificationMapper ($cb_type)
 
 cbAfterInitialize ($cb_type)
 
 setSerializedValue ($field, $value)
 
 setI18nValue ($field, $value)
 
 cbI18N ($type)
 
- Protected Attributes inherited from ModuleManagementModel
 $is_dirty = false
 
- Protected Attributes inherited from SimpleORMap
 $content = []
 
 $content_db = []
 
 $is_new = true
 
 $is_deleted = false
 
 $db_table = ''
 
 $db_fields = null
 
 $pk = null
 
 $default_values = []
 
 $serialized_fields = []
 
 $alias_fields = []
 
 $i18n_fields = []
 
 $additional_fields = []
 
 $relations = []
 
 $has_many = []
 
 $has_one = []
 
 $belongs_to = []
 
 $has_and_belongs_to_many = []
 
 $registered_callbacks = []
 
 $known_slots = []
 
 $notification_map = []
 
 $additional_data = []
 
 $getter_setter_map = []
 
- Static Protected Attributes inherited from ModuleManagementModelTreeItem
static $object_filter = []
 
- Static Protected Attributes inherited from ModuleManagementModel
static $filter_params = []
 
static $perm_object = null
 
- Static Protected Attributes inherited from SimpleORMap
static $config = []
 
static $reserved_slots = ['value','newid','iterator','tablemetadata', 'relationvalue','wherequery','relationoptions','data','new','id']
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $id = null)

Member Function Documentation

◆ assignInstitutes()

assignInstitutes (   $institut_ids)

Assigns other institutes (by id) to this module.

Parameters
array$institut_idsArray of institute ids.
Here is the call graph for this function:

◆ assignLanguagesOfInstruction()

assignLanguagesOfInstruction (   $languages)

Assignes languages of instruction to this part-module.

Parameters
type$languagesAn array of language keys defined in mvv_config.php.
Here is the call graph for this function:

◆ assignResponsibleInstitute()

assignResponsibleInstitute (   $institut_id)

Assigns the responsible institute to this Modul. A Modul has only one (but always one) responsible institute.

Parameters
string$institut_idThe id of the institute to assign.
Returns
boolean True if institute was successfully assigned.
Here is the call graph for this function:

◆ assignUsers()

assignUsers (   $grouped_user_ids)

Assigns users in their groups to this module.

Parameters
array$grouped_user_idsArray of user ids grouped by usergroup.
Here is the call graph for this function:

◆ configure()

static configure (   $config = [])
staticprotected

◆ copy()

copy (   $deep = true,
  $with_assignments = false 
)

Returns a "deep" copy of this object.

Parameters
boolean$deepCopy all assigned modulteile if true
Returns
Modul A copy of this module.
Here is the call graph for this function:

◆ findByFilter()

static findByFilter (   $filter)
static

Returns an array with ids of all modules found by the given filter. The fields from tables mvv_modul and mvv_modul_inst are possible filter options. If no filter is set an empty array will be returned.

See also
ModuleManagementModel::getFilterSql()
Parameters
array$filterKey-value pairs of filed names and values to filter the result set.
Returns
array An array of Modul ids.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ findByInstitut()

static findByInstitut (   $sortby = 'chdate',
  $order = 'ASC',
  $filter = [],
  $row_count = null,
  $offset = null 
)
static

Primarily to find Module by Institute. Possible filters are all fields of the tables mvv_modul, mvv_modulteil, mvv_modul_inst and mvv_modul_deskriptor.

Possible fileds to sort by are count_modulteile, bezeichnung (the name of the modul dereived from the descriptor in the default language) and all fields of table mvv_modul.

Parameters
string$sortby
string$order
array$filter
int$row_count
int$offset
Returns
array Array of Module.
Here is the caller graph for this function:

◆ findByLvgruppe()

static findByLvgruppe (   $lvgruppe_id)
static

Returns all modules the given LV-Gruppe is assigned to at least one Modulteile.

Parameters
string$lvgruppe_idThe id of a LV-Gruppe.
Returns
object A SimpleORMapCollection of modules.

◆ findBySearchTerm()

static findBySearchTerm (   $term,
  $filter = null 
)
static

◆ findByStgteilAbschnitt()

static findByStgteilAbschnitt (   $abschnitt_id,
  $filter 
)
static

Returns all modules assigned to the given Studiengangteil-Abschnitt.

Parameters
string$abschnitt_idThe id of a Studiengangteil-Abschnitt
array$filterKey-value pairs of filed names and values to filter the result set.
Returns
object A SimpleORMapCollection of modules.
Here is the caller graph for this function:

◆ findStatusByIds()

static findStatusByIds (   $modul_ids = null)
static

Returns an array with all types of status found by given modul ids as key and the number of associated module as value.

See also
mvv_config.php for defined status.
Parameters
array$modul_ids
Returns
array An array with status key as key and an array of name of status and number of Module with this status.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAllAssignedInstitutes()

static getAllAssignedInstitutes (   $sortby = 'name',
  $order = 'ASC',
  $filter = null,
  $row_count = null,
  $offset = null 
)
static

Returns all institutes assigned to Module. Sorted and filtered by optional parameters.

Parameters
string$sortbyDB field to sort by.
string$orderASC or DESC
array$filterArray of filter.
Returns
array Array of found Fachbereiche.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAllEnriched()

static getAllEnriched (   $sortby = 'chdate',
  $order = 'ASC',
  $row_count = null,
  $offset = null,
  $filter = null 
)
static

Returns all or a specified (by row count and offset) number of Module sorted and filtered by given parameters and enriched with some additional fields. This function is mainly used in the list view.

Parameters
string$sortbyField name to order by.
string$orderASC or DESC direction of order.
int$row_countThe max number of objects to return.
int$offsetThe first object to return in a result set.
array$filterKey-value pairs of filed names and values to filter the result set.
Returns
SimpleORMapCollection A collection of module objects.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getAssignedCoursesBySemester()

getAssignedCoursesBySemester (   $semester_id,
  $only_visible = true 
)

Retrieves all courses this Modul is assigned by its parts and assigned LV-Gruppen. Filtered by a given semester considering the global visibility or the the visibility for a given user.

Parameters
string$semester_idThe id of a semester.
mixed$only_visibleBoolean true retrieves only visible courses, false retrieves all courses. If $only_visible is an user id it depends on the users status which courses will be retrieved.
Returns
array An array of course data.

◆ getAssignedInstitutes()

static getAssignedInstitutes (   $sortby = 'name',
  $order = 'ASC',
  $modul_ids = [] 
)
static

Returns all Institutes assigned to the given modules.

Parameters
string$sortbyField to sort by.
string$orderOrder of sorting (ASC or DESC).
array$modul_idsIds of modules.
Returns
object a SimpleORMapColection of institutes.

◆ getChildren()

getChildren ( )
See also
MvvTreeItem::getChildren()
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getClassDisplayName()

static getClassDisplayName (   $long = false)
static

◆ getCount()

static getCount (   $filter = null)
static

Returns the number of modules optional filtered by $filter.

Parameters
array$filterKey-value pairs of filed names and values to filter the result set.
Returns
int The number of modules
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getDefaultLanguage()

getDefaultLanguage ( )

Returns the default language for the module descriptor.

Returns
string Short name of language (see mvv_config.php)

◆ getDeskriptor()

getDeskriptor (   $language = null,
  $force_new = false 
)

Returns the Deskriptor in the given language. A Modul has always a Deskriptor in the default language. If the given language is unknown, the method returns the deskriptor in the default language.

Parameters
string$languageThe id of the language
boolIf true returns always a new descriptor
Returns
object The Deskriptor.
Here is the call graph for this function:

◆ getDisplayName()

getDisplayName (   $options = self::DISPLAY_DEFAULT)
Here is the call graph for this function:

◆ getDisplaySemesterValidity()

getDisplaySemesterValidity ( )

Returns a string representation of this module's validity by semesters.

Returns
string The string with the validity by semesters.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEnriched()

static getEnriched (   $modul_id)
static

Retrieves the module and all related data and some additional fields.

Parameters
string$modul_idThe id of the module.
Returns
object The module with additional data or a new module.

◆ getGroupedAssignedUsers()

getGroupedAssignedUsers ( )

Returns an associative array with all assigned users grouped by their functions.

Returns
array Array with group name as key and array of users as value.

◆ getParents()

getParents (   $mode = null)
See also
MvvTreeItem::getParents()
Here is the call graph for this function:

◆ getResponsibleInstitutes()

getResponsibleInstitutes ( )
Here is the call graph for this function:

◆ getTrailParent()

getTrailParent ( )
See also
MvvTreeItem::getTrailParent()
Here is the call graph for this function:

◆ getTrailParentId()

getTrailParentId ( )
See also
MvvTreeItem::getTrailParentId()
Here is the caller graph for this function:

◆ getVariants()

getVariants ( )

Retrieves all modules this module ia a variant of.

Returns
array An array of all variants.
Here is the call graph for this function:

◆ hasChildren()

hasChildren ( )
See also
MvvTreeItem::hasChildren()
Here is the call graph for this function:

◆ publicModulesAvailable()

static publicModulesAvailable ( )
static

Checks if modules with public status are available.

Returns
boolean true if modules with public status available
Here is the call graph for this function:

◆ search()

static search (   $search_term,
  $only_public = true 
)
static

Search modules by search term. This function is used in the search frontend for modules.

Parameters
string$search_term
boolean$only_publicIf true search only for modules with public status.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ validate()

validate ( )
Here is the call graph for this function:

The documentation for this class was generated from the following file: