Stud.IP  6.0
Statusgruppen Class Reference
Inheritance diagram for Statusgruppen:
SimpleORMap PrivacyObject

Public Member Functions

 getChildren ()
 
 getDatafields ()
 
 setDatafields ($data)
 
 getFullGenderedPaths ($user_id, $seperator=" > ", $pre="")
 
 getFullGenderedName ($user_id, $seperator=' > ')
 
 getGenderedName ($user_or_id)
 
 getName ()
 
 hasFolder ()
 
 getFolder ()
 
 updateFolder ($set)
 
 hasBlubber ()
 
 updateBlubber (bool $set)
 
 findTopics ()
 
 findLecturers ()
 
 isMember ($user_id=null)
 
 getPlaces ()
 
 removeAllUsers ()
 
 removeUser ($user_id, $deep=false)
 
 addUser ($user_id, $check=false)
 
 userMayJoin ($user_id)
 
 userMayLeave ($user_id)
 
 userHasExclusiveGroup ($user_id)
 
 sortMembersAlphabetic ()
 
 sortSubGroupsAlphabetic ()
 
 hasSpace ()
 
 moveUser ($user_id, $pos)
 
 remove ()
 
 delete ()
 
 cbAddPosition ()
 
 cbReorderPositions ()
 
 cbRemoveTasks ()
 
- 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 ()
 

Static Public Member Functions

static findAllByRangeId ($range_id, $as_collection=false)
 
static createOrUpdate (?string $id, string $name, ?int $position, string $range_id, int $size, bool $selfassign, int $selfassign_start, int $selfassign_end, bool $makefolder, ?array $dates=null, bool $make_blubber=false)
 
static findBySeminar_id ($course_id)
 
static findByTermin_id ($termin_id)
 
static findContactGroups ($user_id=null)
 
static findJoinableGroups ($range_id, $user_id)
 
static reorderPositionsForRange ($range_id)
 
static getUserRoles ($context, $user)
 
static exportUserData (StoredUserData $storage)
 
static isMemberOf (string $gruppenId, string $userId)
 
- 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)
 

Data Fields

 $keep_children = false
 
- Data Fields inherited from SimpleORMap
const ID_SEPARATOR = '_'
 

Static Protected Member Functions

static configure ($config=[])
 
- 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

- Static Public Attributes inherited from SimpleORMap
static $schemes = 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 SimpleORMap
 $content = []
 
 $content_db = []
 
 $is_new = true
 
 $is_deleted = false
 
 $relations = []
 
 $additional_data = []
 
- 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
 

Member Function Documentation

◆ addUser()

addUser (   $user_id,
  $check = false 
)

Adds a user to a group

Parameters
string$user_idThe user id
boolean$checkif true checks if there is space left in this group
Returns
boolean true if user was added

◆ cbAddPosition()

cbAddPosition ( )

Adds the next free position if position is null.

◆ cbRemoveTasks()

cbRemoveTasks ( )

This callback is called after deleting a User. It removes courseware task entries that are associated with the group.

◆ cbReorderPositions()

cbReorderPositions ( )

Reorders position after delete or for the assoicated range_id.

◆ configure()

static configure (   $config = [])
staticprotected

◆ createOrUpdate()

static createOrUpdate ( ?string  $id,
string  $name,
?int  $position,
string  $range_id,
int  $size,
bool  $selfassign,
int  $selfassign_start,
int  $selfassign_end,
bool  $makefolder,
?array  $dates = null,
bool  $make_blubber = false 
)
static

Creates or updates a statusgroup.

Parameters
string | null$idID of an existing group or empty if new group
string$namegroup name
int | null$positionposition or null if automatic position after other groups
string$range_idID of the object this group belongs to
int$sizemax number of members or 0 if unlimited
bool$selfassignmay users join this group by themselves?
int$selfassign_startgroup joining is possible starting at ...
int$selfassign_endgroup joining is possible until ...
bool$makefoldercreate a document folder assigned to this group?
array | null$datesdates assigned to this group. Defaults to null which means already assigned dates are not changed.
bool$make_blubbercreate a blubber thread for this group?
Returns
Statusgruppen The saved statusgroup.
Exceptions
Exception

◆ delete()

delete ( )

Deletes a status group and all it's child groups.

Returns
int number of deleted groups

◆ 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.

◆ findAllByRangeId()

static findAllByRangeId (   $range_id,
  $as_collection = false 
)
static

◆ findBySeminar_id()

static findBySeminar_id (   $course_id)
static

Finds all statusgroups by a course id

Parameters
stringThe course id
Returns
array Statusgroups

◆ findByTermin_id()

static findByTermin_id (   $termin_id)
static

◆ findContactGroups()

static findContactGroups (   $user_id = null)
static

◆ findJoinableGroups()

static findJoinableGroups (   $range_id,
  $user_id 
)
static

Find all groups belonging to the given range_id that may be joined by the given user.

Parameters
String$range_idrange_id the groups shall belong to
String$user_iduser to check
Returns
array

◆ findLecturers()

findLecturers ( )

Finds Lecturers assigned to this group via course dates.

Returns
array

◆ findTopics()

findTopics ( )

Finds CourseTopics assigned to this group via course dates.

Returns
array

◆ getChildren()

getChildren ( )

◆ getDatafields()

getDatafields ( )

◆ getFolder()

getFolder ( )

Gets the folder assigned to this statusgroup.

Returns
CourseGroupFolder|null

◆ getFullGenderedName()

getFullGenderedName (   $user_id,
  $seperator = ',
 
)

Produces string of all statusgroups a user is in (upwards from the current group)

Parameters
string$user_idThe user_id
string$seperatorThe sign between the full paths
Returns
array String of full gendered paths separated by given separator

◆ getFullGenderedPaths()

getFullGenderedPaths (   $user_id,
  $seperator = " > ",
  $pre = "" 
)

Produces an array of all statusgroups a user is in

Parameters
string$user_idThe user_id
string$seperatorThe sign between the full paths
string$prePreface of the outputted string (used for recursion)
Returns
array Stringarray of full gendered paths

◆ getGenderedName()

getGenderedName (   $user_or_id)

Returns the gendered name of a statusgroup

Parameters
string | User$user_idThe user_id
Returns
string The gendered name

◆ getName()

getName ( )

◆ getPlaces()

getPlaces ( )

Displayfunction to show the places left in this group

Returns
string displaystring

◆ getUserRoles()

static getUserRoles (   $context,
  $user 
)
static

Puts out an array of all gendered userroles for a user in a certain context

Parameters
string$contextThe context
string$userThe user id
Returns
array All roles

◆ hasBlubber()

hasBlubber ( )

Returns whether the group has an associated blubber thread.

◆ hasFolder()

hasFolder ( )

Checks if a statusgroup has a folder.

Returns
boolean true</> if the statusgroup has a folder, else false

◆ hasSpace()

hasSpace ( )

Checks if there is free space in this group

Returns
true if there is free space

◆ isMember()

isMember (   $user_id = null)

Checks if a user is a member of this group

Parameters
string$user_idThe user id
Returns
boolean true if user is a member of this group

◆ isMemberOf()

static isMemberOf ( string  $gruppenId,
string  $userId 
)
static

Checks if a user is a member of a group.

Parameters
string$user_idThe user id
Returns
boolean true if user is a member of this group

(PHPMD.StaticAccess)

◆ moveUser()

moveUser (   $user_id,
  $pos 
)

Move a user to a position of a group

Parameters
string$user
type$pos

◆ remove()

remove ( )

Deletes a status group. Any associated child group will move upwards in the tree.

◆ removeAllUsers()

removeAllUsers ( )

Remove all users of this group

◆ removeUser()

removeUser (   $user_id,
  $deep = false 
)

Remove one user from this group

Parameters
string$user_idThe user id
bool$deepRemove user from children as well?
Returns
bool

◆ reorderPositionsForRange()

static reorderPositionsForRange (   $range_id)
static

Reorders the positions in numeric order without gaps (e.g. after a delete).

Parameters
string$range_idId of range

◆ setDatafields()

setDatafields (   $data)

◆ sortMembersAlphabetic()

sortMembersAlphabetic ( )

Sorts the member of a group alphabetic

◆ sortSubGroupsAlphabetic()

sortSubGroupsAlphabetic ( )

Sorts subgroups alphabetical

◆ updateBlubber()

updateBlubber ( bool  $set)

Delete or create blubber thread

Parameters
bool$setWhether to create a blubber thread or not; an existing blubber thread will be deleted if $set is false

◆ updateFolder()

updateFolder (   $set)

Delete or create a folder

Parameters
boolean$settrue Create a folder false Unlink the existing folder from the group

◆ userHasExclusiveGroup()

userHasExclusiveGroup (   $user_id)

Checks if the user is already in an exclusive group of this range

Parameters
string$user_idThe user id
Returns
boolean true if user has already an exclusive group

◆ userMayJoin()

userMayJoin (   $user_id)

Checks if a user could join this group

Parameters
string$user_idThe user id
Returns
boolean true if user is allowed to join

◆ userMayLeave()

userMayLeave (   $user_id)

Checks if a user could leave this group

Parameters
string$user_idThe user id
Returns
boolean true if user is allowed to leave

Field Documentation

◆ $keep_children

$keep_children = false

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