Stud.IP  5.4
Deputy Class Reference
Inheritance diagram for Deputy:
SimpleORMap

Public Member Functions

 getDeputyFullname ($format='full')
 
 getBossFullname ($format='full')
 
 getCourseFullname ($format='default')
 
- 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 addDeputy ($user_id, $range_id)
 
static isDeputy (string $user_id, string $range_id, bool $check_edit_about=false)
 
static isActivated ()
 
static isEditActivated ()
 
static getValidPerms ($min_perm_only=false)
 
static findDeputies (string $range_id=null)
 
static findDeputyBosses (string $user_id=null)
 
static findDeputyCourses (string $user_id=null)
 
static getMySeminarsQuery ($type, $sem_number_sql, $sem_number_end_sql, $add_fields, $add_query, $studygroups=false)
 
- 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 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 SimpleORMap
const ID_SEPARATOR = '_'
 
- 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

◆ addDeputy()

static addDeputy (   $user_id,
  $range_id 
)
static

Adds a person as deputy of a course or another person.

Parameters
string$user_idperson to add as deputy
string$range_idID of a course or a person
Returns
int Number of affected rows in the database (hopefully 1).

◆ configure()

static configure (   $config = [])
staticprotected

◆ findDeputies()

static findDeputies ( string  $range_id = null)
static

Fetches all deputies of the given course or person.

Parameters
string | null$range_idID of a course or person
Returns
SimpleCollection An array containing all deputies.

◆ findDeputyBosses()

static findDeputyBosses ( string  $user_id = null)
static

Fetches all persons of which the given person is default deputy.

Parameters
string | null$user_idthe user to check
Returns
SimpleCollection An array of the given person's bosses.

◆ findDeputyCourses()

static findDeputyCourses ( string  $user_id = null)
static

Fetch all courses of which the given person is default deputy.

Parameters
string | null$user_id
Returns
SimpleCollection

◆ getBossFullname()

getBossFullname (   $format = 'full')

Gets the full boss name (in fact just redirecting to User class)

See also
User::getFullName
Parameters
string$formatone of full,full_rev,no_title,no_title_rev,no_title_short,no_title_motto,full_rev_username
Returns
string The bosses full name, like "John Doe" or "Doe, John"

◆ getCourseFullname()

getCourseFullname (   $format = 'default')

Gets the full course name (in fact just redirecting to Course class)

See also
Course::getFullName
Parameters
string$formatone of default, type-name, number-type-name, number-name, number-name-semester, sem-duration-name
Returns
string The courses' full name, like "1234 Lecture: Databases"

◆ getDeputyFullname()

getDeputyFullname (   $format = 'full')

Gets the full deputy name (in fact just redirecting to User class)

See also
User::getFullName
Parameters
string$formatone of full,full_rev,no_title,no_title_rev,no_title_short,no_title_motto,full_rev_username
Returns
string The deputy's full name, like "John Doe" or "Doe, John"

◆ getMySeminarsQuery()

static getMySeminarsQuery (   $type,
  $sem_number_sql,
  $sem_number_end_sql,
  $add_fields,
  $add_query,
  $studygroups = false 
)
static

Database query for retrieving all courses where the current user is deputy in.

Parameters
string$typeare we in the "My courses" list (='my_courses') or in grouping or notification view ('gruppe', 'notification') or outside Stud.IP in the notification cronjob (='notification_cli')?
string$sem_number_sqlSQL for specifying the semester for a course
string$sem_number_end_sqlSQL for specifying the last semester a course is in
string$add_fieldsoptionally necessary fields from database
string$add_queryadditional joins
Returns
string The SQL query for getting all courses where the current user is deputy in

◆ getValidPerms()

static getValidPerms (   $min_perm_only = false)
static

Shows which permission level a person must have in order to be available as deputy.

Parameters
boolean$min_perm_onlywhether to give only the minimum permission or a set of all valid permissions available for being deputy
Returns
mixed The minimum permission needed for being deputy or a set of all permissions between minimum and "admin"

◆ isActivated()

static isActivated ( )
static

Checks if persons may be assigned as default deputy of other persons.

Returns
boolean activation status of the default deputy functionality.

◆ isDeputy()

static isDeputy ( string  $user_id,
string  $range_id,
bool  $check_edit_about = false 
)
static

Checks whether the given person is a deputy in the given context (course or person).

Parameters
string$user_idperson ID to check
string$range_idcourse or person ID
boolean$check_edit_aboutcheck if the given person may edit the other person's profile
Returns
boolean Is the given person deputy in the given context?

◆ isEditActivated()

static isEditActivated ( )
static

Checks if default deputies may get the rights to edit their bosses profile page.

Returns
boolean activation status of the deputy boss profile page editing functionality.

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