Stud.IP  6.0
User Class Reference
Inheritance diagram for User:
AuthUserMd5 Range PrivacyObject Owner SimpleORMap

Public Member Functions

 store ()
 
 triggerChdate ()
 
 getFullName ($format='default')
 
 toArrayRecursive ($only_these_fields=null)
 
 hasRole ($role, $institute_id='')
 
 getRoles ($with_implicit=false)
 
 isFriendOf ($another_user)
 
 isDirty ()
 
 isFieldDirty ($field)
 
 revertValue ($field)
 
 getPristineValue ($field)
 
 toRawArray ($only_these_fields=null)
 
 initRelation ($relation)
 
 getInstitutePerms ()
 
 getStudipKingIcon ()
 
 getHomepageElements ()
 
 changeEmail ($email, $force=false)
 
 describeRange ()
 
 getRangeType ()
 
 getRangeId ()
 
 getConfiguration ()
 
 isAccessibleToUser ($user_id=null)
 
 isEditableByUser ($user_id=null)
 
 cbRemoveFeedback ()
 
 cbRemoveForumVisits ()
 
 cbClearCaches ()
 
 __toString ()
 
 isBlocked ()
 
 isExpired ()
 
 isCalendarReadable (?string $user_id=null)
 
 isCalendarWritable (string $user_id=null)
 
 getGender ()
 
 getSalutation ()
 
 hasPermissionLevel (string $permission, ?Range $for_range=null)
 
- 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 Owner
 isCalendarWritable (?string $user_id=null)
 

Static Public Member Functions

static findCurrent ()
 
static build ($data, $is_new=true)
 
static findFull ($id)
 
static findFullMany ($ids, $order_by='')
 
static findByUsername ($username)
 
static findByDatafield ($datafield_id, $value)
 
static search ($attributes)
 
static convert ($old_id, $new_id, $identity=false)
 
static exportUserData (StoredUserData $storage)
 
static getCalendarOwner (string $owner_id)
 
- 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)
 

Protected Member Functions

 cbStudipLog ($type)
 
- 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)
 

Static Protected Member Functions

static configure ($config=[])
 
- Static Protected Member Functions inherited from AuthUserMd5
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 Attributes inherited from SimpleORMap
 $content = []
 
 $content_db = []
 
 $is_new = true
 
 $is_deleted = false
 
 $relations = []
 
 $additional_data = []
 
string $i18n_class = I18NString::class
 
- 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

◆ __toString()

__toString ( )
See also
Range::__toString()

Implements Range.

◆ build()

static build (   $data,
  $is_new = true 
)
static

build new object with given data

Parameters
$dataarray assoc array of record
Returns
User

◆ cbClearCaches()

cbClearCaches ( )

◆ cbRemoveFeedback()

cbRemoveFeedback ( )

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

◆ cbRemoveForumVisits()

cbRemoveForumVisits ( )

This callback is called after deleting a User. It removes forum visit entries that are associated with the User.

◆ cbStudipLog()

cbStudipLog (   $type)
protected
Parameters
$typestring type of callback

◆ changeEmail()

changeEmail (   $email,
  $force = false 
)

Changes a user's email adress.

Parameters
string$emailNew email
bool$forceForce update (even if nothing actually changed)
Returns
bool

◆ configure()

static configure (   $config = [])
staticprotected

◆ convert()

static convert (   $old_id,
  $new_id,
  $identity = false 
)
static

Merge an user ($old_id) to another user ($new_id). This is a part of the old numit-plugin.

Parameters
string$old_user
string$new_user
boolean$identitymerge identity (if true)
Returns
array() messages to display after migration

◆ describeRange()

describeRange ( )

Returns a descriptive text for the range type.

Returns
string

Implements Range.

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

◆ findByDatafield()

static findByDatafield (   $datafield_id,
  $value 
)
static

returns an array of User-objects that have the given value in the given datafield.

Parameters
string$datafield_id
arrayof User

◆ findByUsername()

static findByUsername (   $username)
static

return user object for given username

Parameters
string$usernamea username
Returns
User

◆ findCurrent()

static findCurrent ( )
static

Returns the currently authenticated user.

Returns
?User User

◆ findFull()

static findFull (   $id)
static

Returns user object including user_info

Parameters
string$id
Returns
?User User

◆ findFullMany()

static findFullMany (   $ids,
  $order_by = '' 
)
static

Returns user objects including user_info

Parameters
array$ids
string$order_by
Returns
User[] User

◆ getCalendarOwner()

static getCalendarOwner ( string  $owner_id)
static

Implements Owner.

◆ getConfiguration()

getConfiguration ( )

{Returns the configuration object for this range.

Returns
RangeConfig
}

Implements Range.

◆ getFullName()

getFullName (   $format = 'default')

returns the name in specified format (formats defined in $GLOBALS['_fullname_sql'])

Parameters
stringone of full,full_rev,no_title,no_title_rev,no_title_short,no_title_motto,full_rev_username
Returns
string guess what - the fullname

Implements Range.

◆ getGender()

getGender ( )

Delivers the gender as text

Returns
string

◆ getHomepageElements()

getHomepageElements ( )

Builds an array containing all available elements that are part of a user's homepage together with their visibility. It isn't sufficient to just load the visibility settings from database, because if the user has added some data (e.g. CV) but not yet assigned a special visibility to that field, it wouldn't show up.

Returns
array An array containing all available homepage elements together with their visibility settings in the form $name => $visibility.

◆ getInstitutePerms()

getInstitutePerms ( )

This function returns the perms allowed for an institute for the current user

Returns
array list of perms

◆ getPristineValue()

getPristineValue (   $field)

returns unmodified value of given field

Parameters
string$field
Exceptions
InvalidArgumentException
Returns
mixed

◆ getRangeId()

getRangeId ( )

Returns the id of the current range

Returns
mixed (string|int)

Implements Range.

◆ getRangeType()

getRangeType ( )

Returns a unique identificator for the range type.

Returns
string

Implements Range.

◆ getRoles()

getRoles (   $with_implicit = false)

Returns the roles that were assigned to the user.

Parameters
boolean$with_implicit
Returns
array

◆ getSalutation()

getSalutation ( )

Delivers the gender as text

Returns
string

◆ getStudipKingIcon()

getStudipKingIcon ( )

Get the decorated StudIP-Kings information

Returns
String

◆ hasPermissionLevel()

hasPermissionLevel ( string  $permission,
?Range  $for_range = null 
)

◆ hasRole()

hasRole (   $role,
  $institute_id = '' 
)

Returns whether the user was assigned a certain role.

Parameters
string$roleThe role to check
string$institute_idAn optional institute_id
Returns
bool True if the user was assigned this role, false otherwise

◆ initRelation()

initRelation (   $relation)
Parameters
string$relation

◆ isAccessibleToUser()

isAccessibleToUser (   $user_id = null)

Decides whether the user may access the range.

Parameters
string | null$user_idOptional id of a user, defaults to current user
Returns
bool

Implements Range.

◆ isBlocked()

isBlocked ( )

Returns whether a user is blocked either explicitely due to the "locked" property or by a set expiration date.

Returns
bool
Since
Stud.IP 5.4

◆ isCalendarReadable()

isCalendarReadable ( ?string  $user_id = null)

Implements Owner.

◆ isCalendarWritable()

isCalendarWritable ( string  $user_id = null)

◆ isDirty()

isDirty ( )

checks if at least one field was modified since last restore

Returns
boolean

◆ isEditableByUser()

isEditableByUser (   $user_id = null)

Decides whether the user may edit/alter the range.

Parameters
string | null$user_idOptional id of a user, defaults to current user
Returns
bool

Implements Range.

◆ isExpired()

isExpired ( )

Returns whether a user account is expired.

Returns
bool
Since
Stud.IP 5.4

◆ isFieldDirty()

isFieldDirty (   $field)

checks if given field was modified since last restore

Parameters
string$field
Returns
boolean

◆ isFriendOf()

isFriendOf (   $another_user)

Returns whether the given user is stored in contacts.

Parameters
User$another_user
Returns
bool

◆ revertValue()

revertValue (   $field)

reverts value of given field to last restored value

Parameters
string$field
Returns
mixed the restored value

◆ search()

static search (   $attributes)
static

Temporary migrate to User.php

Parameters
$attributes
Returns
array

◆ store()

store ( )

◆ toArrayRecursive()

toArrayRecursive (   $only_these_fields = null)

◆ toRawArray()

toRawArray (   $only_these_fields = null)

Returns data of table row as assoc array with raw contents like they are in the database. Pass array of fieldnames or ws separated string to limit fields.

Parameters
mixed$only_these_fields
Returns
array

◆ triggerChdate()

triggerChdate ( )

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