Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
User Class Reference
Inheritance diagram for User:
AuthUserMd5 Range PrivacyObject 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 ()
 
 cbClearCaches ()
 
 __toString ()
 
- 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 ()
 
- Public Member Functions inherited from Range
 getFullname ($format= 'default')
 

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 Public Member Functions inherited from SimpleORMap
static tableScheme ($db_table)
 
static expireTableScheme ()
 
static exists ($id)
 
static countBySql ($sql= '1', $params=[])
 
static create ($data)
 
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 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 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)
 
 cbAutoIncrementColumn ($type)
 
 cbAutoKeyCreation ()
 
 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

__toString ( )
See Also
Range::__toString()

Implements Range.

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

build new object with given data

Parameters
$dataarray assoc array of record
Returns
User
cbClearCaches ( )
cbRemoveFeedback ( )

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

changeEmail (   $email,
  $force = false 
)

Changes a user's email adress.

Parameters
string$emailNew email
bool$forceForce update (even if nothing actually changed)
Returns
bool
static configure (   $config = [])
staticprotected
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 ( )

Returns a descriptive text for the range type.

Returns
string

Implements Range.

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.

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
static findByUsername (   $username)
static

return user object for given username

Parameters
string$usernamea username
Returns
User
static findCurrent ( )
static

Returns the currently authenticated user.

Returns
?User User
static findFull (   $id)
static

Returns user object including user_info

Parameters
string$id
Returns
?User User
static findFullMany (   $ids,
  $order_by = '' 
)
static

Returns user objects including user_info

Parameters
array$ids
string$order_by
Returns
User[] User
getConfiguration ( )

{Returns the configuration object for this range.

Returns
RangeConfig
}

Implements Range.

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
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 ( )

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

Returns
array list of perms
getPristineValue (   $field)

returns unmodified value of given field

Parameters
string$field
Exceptions
InvalidArgumentException
Returns
mixed
getRangeId ( )

Returns the id of the current range

Returns
mixed (string|int)

Implements Range.

getRangeType ( )

Returns a unique identificator for the range type.

Returns
string

Implements Range.

getRoles (   $with_implicit = false)

Returns the roles that were assigned to the user.

Parameters
boolean$with_implicit
Returns
array
getStudipKingIcon ( )

Get the decorated StudIP-Kings information

Returns
String
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 (   $relation)
Parameters
string$relation
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.

isDirty ( )

checks if at least one field was modified since last restore

Returns
boolean
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.

isFieldDirty (   $field)

checks if given field was modified since last restore

Parameters
string$field
Returns
boolean
isFriendOf (   $another_user)

Returns whether the given user is stored in contacts.

Parameters
User$another_user
Returns
bool
revertValue (   $field)

reverts value of given field to last restored value

Parameters
string$field
Returns
mixed the restored value
static search (   $attributes)
static

Temporary migrate to User.class.php

Parameters
$attributes
Returns
array
store ( )
toArrayRecursive (   $only_these_fields = null)
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 ( )

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