Stud.IP  6.0
Fach Class Reference
Inheritance diagram for Fach:
ModuleManagementModelTreeItem PrivacyObject ModuleManagementModel MvvTreeItem SimpleORMap ModuleManagementInterface

Public Member Functions

 __construct ($id=null)
 
 assignFachbereiche ($fachbereiche)
 
 getFachbereiche ()
 
 getAbschluesse ()
 
 getTrailParentId ()
 
 getTrailParent ()
 
 getChildren ()
 
 hasChildren ()
 
 getParents ($mode=null)
 
 getRelatedModules ($only_public=true, $modul_ids=null)
 
 validate ()
 
 getResponsibleInstitutes ()
 
 countUser ()
 
 countUserByDegree ($degree_id)
 
- 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 ()
 
 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)
 
 isRelation ($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 ()
 
- Public Member Functions inherited from MvvTreeItem
 getId ()
 
 getDisplayName ()
 

Static Public Member Functions

static getAllEnriched ($sortby='name', $order='ASC', $row_count=null, $offset=null, $filter=null)
 
static getCount ($filter=null)
 
static getAllEnrichedByStgteile ($sortby='name', $order='ASC', $row_count=null, $offset=null, $filter=null)
 
static findByStudiengangTeil ($stgteil_id)
 
static findByStudiengang ($studiengang_id)
 
static findByAbschluss ($abschluss_id)
 
static findByFachbereich ($fachbereich_id, $has_stgteile=false)
 
static findPublicByModule ($modul_ids)
 
static findBySearchTermStgteile ($term)
 
static findByIdsStgteile ($stgteil_ids, $sortby='name', $order='ASC', $row_count=null, $offset=null, $filter=null)
 
static getAssignedFachbereiche ($order='ASC')
 
static getAllAssignedInstitutes ($studiengang_ids=[])
 
static findUsedFachbereiche ($kategorie_id=null, $abschluss_id=null)
 
static getAllFachbereiche ($sortby='name', $order='ASC', $filter=null)
 
static toArrayByFachbereichStgteil ($fachbereich_id, $stgteil_id)
 
static getClassDisplayName ($long=false)
 
static exportUserData (StoredUserData $storage)
 
- Static Public Member Functions inherited from ModuleManagementModelTreeItem
static getPathes ($trails, $delimiter=' · ')
 
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 () = htmlReady($modul['name'])
 
static getLocaleOrdinalNumberSuffix ($num)
 
static getPublicStatus ($class_name=null)
 
static findCached ($id, $index=null)
 
static clearCache ($index=null)
 
- Static Public Member Functions inherited from SimpleORMap
static tableScheme ($db_table)
 
static expireTableScheme ()
 
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 (string $name, array $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 configure ($config=[])
 
static checkSortFields ($sort, $standard_field=null, $additional_fields=[])
 
static createSortStatement ($sort, $order='ASC', $standard_field=null, $additional_fields=[])
 
static fromCache ($index, $id, Callable $finder)
 
static formatDisplayName (string $template, array $placeholders, array $replacements)
 
- Static Protected Member Functions inherited from SimpleORMap
static db_table ()
 
static db_fields ()
 
static pk ()
 
static default_values ()
 
static serialized_fields ()
 
static alias_fields ()
 
static i18n_fields ()
 
static additional_fields ()
 
static has_many ()
 
static has_one ()
 
static belongs_to ()
 
static has_and_belongs_to_many ()
 
static registered_callbacks ()
 
static known_slots ()
 
static notification_map ()
 
static getter_setter_map ()
 
static configure ($config=[])
 
static config ($key)
 
static registerCallback ($types, $cb)
 
static unregisterCallback ($types, $cb)
 

Additional Inherited Members

- Data Fields inherited from ModuleManagementModel
 $object_real_name = ''
 
- Data Fields inherited from SimpleORMap
const ID_SEPARATOR = '_'
 
- Data Fields inherited from MvvTreeItem
const TRAIL_SHOW_INCOMPLETE = 1
 
- 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)
 
 cbNotificationMapper ($cb_type)
 
 cbAfterInitialize ($cb_type)
 
 setSerializedValue ($field, $value)
 
 setI18nValue ($field, $value)
 
- Protected Attributes inherited from ModuleManagementModel
 $is_dirty = false
 
- Protected Attributes inherited from SimpleORMap
 $content = []
 
 $content_db = []
 
 $is_new = true
 
 $is_deleted = false
 
 $relations = []
 
 $additional_data = []
 
- Static Protected Attributes inherited from ModuleManagementModelTreeItem
static $object_filter = []
 
- Static Protected Attributes inherited from ModuleManagementModel
static $filter_params = []
 
static $perm_object = null
 
static $object_cache = []
 
- Static Protected Attributes inherited from SimpleORMap
static $config = []
 
static $reserved_slots = ['value','newid','iterator','tablemetadata', 'relationvalue','wherequery','relationoptions','data','new','id']
 
static $performs_batch_operation = false
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $id = null)
Parameters
string$idprimary key of table

Implements ModuleManagementInterface.

Member Function Documentation

◆ assignFachbereiche()

assignFachbereiche (   $fachbereiche)

Assignes fachbereiche to this fach. Returns true only if all given fachbereich ids are valid.

Parameters
string[]|object[]Array of $fachbereich_ids or fachbereich objects.
Returns
boolean True if fachbereiche was successfully assigned.

◆ configure()

static configure (   $config = [])
staticprotected

◆ countUser()

countUser ( )

The number of users this Fach was selected by.

Returns
int The number of users.

◆ countUserByDegree()

countUserByDegree (   $degree_id)

The number of users this Fach was selected by. Filtered by given degree (Abschluss).

Returns
int The number of users.

◆ exportUserData()

static exportUserData ( StoredUserData  $storage)
static

Export available data of a given user into a storage object (an instance of the StoredUserData class) for that user.

Parameters
StoredUserData$storageobject to store data into

Implements PrivacyObject.

◆ findByAbschluss()

static findByAbschluss (   $abschluss_id)
static

Retrieves all Faecher implicitly assigned to the given Abschluss.

Parameters
string$abschluss_idThe id of the Abschluss.
Returns
object Collection of Faecher assigned to the given Abschluss.

◆ findByFachbereich()

static findByFachbereich (   $fachbereich_id,
  $has_stgteile = false 
)
static

Retrieves all Faecher the giveb Fachbereich is assigned to. If the 2nd parameter is true, only Faecher assigned to Studiengangteile will be returned.

Parameters
string$abschluss_idThe id of the Abschluss.
Returns
object Collection of Faecher assigned to the given Abschluss.

◆ findByIdsStgteile()

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

Returns all Faecher which are assigned to the given Studiengangteile. Sorted and filtered by optional parameters.

Parameters
arrayArray of Studiengangteil ids.
string$sortbyColumn names to sort by.
strind$orderDirection of sorting ASC|DESC.
int$row_countNumber of rows to return.
int$offsetOffset of first row to return.
array$filterArray of filter parameters (name of column as key,
Returns
object Collection of Faecher.

◆ findBySearchTermStgteile()

static findBySearchTermStgteile (   $term)
static

Retrieves all Faecher by given search term. The term is compared to name of the Fach and the column "zusatz" of the Studiengangteil the Fach ist assigned to.

Parameters
string$termThe search term.
Returns
object Collection of Faecher.

◆ findByStudiengang()

static findByStudiengang (   $studiengang_id)
static

Retrieves all Faecher assigned to the given Studiengang.

Parameters
string$studiengang_idThe id of the Studiengang.
Returns
object Collection of Faecher assigned to the given Studiengang.

◆ findByStudiengangTeil()

static findByStudiengangTeil (   $stgteil_id)
static

Retrieves the Fach assigned to the given Studiengangteil.

Parameters
string$stgteil_idThe id of the Studiengangteil.
Returns
object Fach assigned to the given Studiengangteil contained in a collection.

◆ findPublicByModule()

static findPublicByModule (   $modul_ids)
static

Retrieves all Faecher implicitly assigned by public Studiengangteile to the given modules.

Parameters
array$modul_idsIds of modules.
Returns
object Collection of Faecher.

◆ findUsedFachbereiche()

static findUsedFachbereiche (   $kategorie_id = null,
  $abschluss_id = null 
)
static

Finds all Fachbereiche assigned to Faecher. The result can be filtered by a Abschluss-Kategorie or an Abschluss.

Parameters
string$kategorie_idThe id of the Abschluss-Kategorie.
string$abschluss_idThe id of the Abschluss.
Returns
array Found Fachbereiche as array. Empty array if none was found.

◆ getAbschluesse()

getAbschluesse ( )

Returns all Abschluesse this Fach is implicitly assigned to.

Returns
A collection of Faecher.

◆ getAllAssignedInstitutes()

static getAllAssignedInstitutes (   $studiengang_ids = [])
static

Returns an associative array of institutes (name and id) assigned to studiengaenge. Can be filtered by ids of studiengaenge.

Parameters
array$studiengang_idsLimits the result to these studiengaenge.
Returns
array Associative array (id and name) of institutes.

◆ getAllEnriched()

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

Returns all or a specified (by row count and offset) number of Abschluesse 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.
array$filterKey-value pairs of filed names and values to filter the result set.
int$row_countThe max number of objects to return.
int$offsetThe first object to return in a result set.
Returns
object A SimpleORMapCollection of Abschluss objects.

◆ getAllEnrichedByStgteile()

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

Returns all Faecher which are assigned to Studiengangteile. Sorted and filtered by optional parameters.

Parameters
string$sortbyColumn names to sort by.
strind$orderDirection of sorting ASC|DESC.
int$row_countNumber of rows to return.
int$offsetOffset of first row to return.
array$filterArray of filter parameters (name of column as key,
Returns
object Collection of Faecher.

◆ getAllFachbereiche()

static getAllFachbereiche (   $sortby = 'name',
  $order = 'ASC',
  $filter = null 
)
static

Returns names ans ids of all Fachbereiche (institutes) with number of related Faecher. Sorted and filtered by optional parameters.

Parameters
string$sortbyColumn names to sort by.
strind$orderDirection of sorting ASC|DESC.
array$filterArray of filter parameters (name of column as key, see ModulManagementModel::getFilterSql()).
Returns
array Associative array of Fachbereiche (id as key).

◆ getAssignedFachbereiche()

static getAssignedFachbereiche (   $order = 'ASC')
static

Returns an associative array of all Fachbereiche assigned to Faecher.

Parameters
string$orderDirection of sorting ASC|DESC.
Returns
array An associative array of Faecher.

◆ getChildren()

getChildren ( )

◆ getClassDisplayName()

static getClassDisplayName (   $long = false)
static

◆ getCount()

static getCount (   $filter = null)
static

Returns the number of Fächer optional filtered by $filter.

Parameters
array$filterKey-value pairs of filed names and values to filter the result set.
Returns
int The number of Fächer

◆ getFachbereiche()

getFachbereiche ( )

Returns all Fachbereiche assigned to this Fach.

Returns
array All assigned Fachbereiche.

◆ getParents()

getParents (   $mode = null)

◆ getRelatedModules()

getRelatedModules (   $only_public = true,
  $modul_ids = null 
)

Returns ids of all modules which are related to this Fach. The relation is done by assigning a Fach to a Studiengangteil and the modules to a version of that Studiengangteil.

Parameters
boolean$only_publicIf true only modules with a public state will be returned.
Returns
array

◆ getResponsibleInstitutes()

getResponsibleInstitutes ( )

Returns all responsible institutes.

Returns
array An array of Fachbereich objects.

◆ getTrailParent()

getTrailParent ( )

◆ getTrailParentId()

getTrailParentId ( )

◆ hasChildren()

hasChildren ( )

◆ toArrayByFachbereichStgteil()

static toArrayByFachbereichStgteil (   $fachbereich_id,
  $stgteil_id 
)
static

Returns an array with all faecher which are used by given Fachbereich and the given Studiengangteil.

Parameters
string$fachbereich_idThe id of a Fachbereich (institute)
string$stgteil_idThe id oa a Studiengangteil.
Returns
array Associative array of Faecher with id as key.

◆ validate()

validate ( )

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