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

Public Member Functions

 countCourses ()
 
 countUsers ()
 
 addUser ($user_id)
 
 removeUser ($user_id)
 
 addSeminar ($seminar_id)
 
 removeSeminar ($seminar_id)
 
 __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)
 
 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 getUserDomains ()
 
static getUserDomainsForUser ($user_id)
 
static removeUserDomainsForUser ($user_id)
 
static getUserDomainsForSeminar ($seminar_id)
 
static removeUserDomainsForSeminar ($seminar_id)
 
static checkUserVisibility ($domains_owned, $domains_to_check)
 
static checkCourseVisibility ($domains_owned, $domains_to_check)
 
- 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

const REGEXP = '^[\\w\.\-]{1,32}$'
 
- 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

◆ __toString()

__toString ( )

Converts the user domain into a string. This is required for array_diff() purposes in order to check whether userdomains of users or user and course match up.

Returns
string representation of the user domain

◆ addSeminar()

addSeminar (   $seminar_id)

Add a seminar to this user domain.

◆ addUser()

addUser (   $user_id)

Add a user to this user domain.

◆ checkCourseVisibility()

static checkCourseVisibility (   $domains_owned,
  $domains_to_check 
)
static

◆ checkUserVisibility()

static checkUserVisibility (   $domains_owned,
  $domains_to_check 
)
static

Check the visibility for two sets of domains. The visibility is only given when any of the following cases is true:

  • both sets of domains are empty
  • the check is not strict and no domains are owned
  • any of the owned domains has no restricted access
  • the check is not strict and any of the domains to check has no restricted access
    • the two sets of domains contain at least one same domain
Parameters
array$domains_ownedDomains owned by the object
array$domains_to_checkDomains to check against
boolean$strictPerform a strict check; optional, default: false
Returns
bool indicating whether visibility is given or not

◆ configure()

static configure (   $config = [])
staticprotected

◆ countCourses()

countCourses ( )

Count the number of courses associated with this user domain.

Returns
int number of courses

◆ countUsers()

countUsers ( )

Count the number of courses associated with this user domain.

Returns
int number of users

◆ getUserDomains()

static getUserDomains ( )
static

Get an array of all defined user domains. Returns an array of UserDomain objects.

◆ getUserDomainsForSeminar()

static getUserDomainsForSeminar (   $seminar_id)
static

Get an array of all user domains for a specific seminar. Returns an array of UserDomain objects.

◆ getUserDomainsForUser()

static getUserDomainsForUser (   $user_id)
static

Get an array of all user domains for a specific user. Returns an array of UserDomain objects.

◆ removeSeminar()

removeSeminar (   $seminar_id)

Remove a seminar from this user domain.

◆ removeUser()

removeUser (   $user_id)

Remove a user from this user domain.

◆ removeUserDomainsForSeminar()

static removeUserDomainsForSeminar (   $seminar_id)
static

Remove all user domains for a specific seminar.

◆ removeUserDomainsForUser()

static removeUserDomainsForUser (   $user_id)
static

Remove all user domains for a specific user.

Field Documentation

◆ REGEXP

const REGEXP = '^[\\w\.\-]{1,32}$'

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