Properties

$

$ :mixed|null

alias

Type

mixed|null

$

$ :string|null

emailaddress

Type

string|null

$

$ :string|null

surname

Type

string|null

$

$ :string|null

firstname

Type

string|null

$companies

$companies :null

Buffer for companies

Type

null

Methods

__construct()

__construct(integer  $id = null,string  $language = null)

User constructor.

Parameters

integer $id

A user id

string $language

The language id

Id()

Id(): integer

Expose the user id Provide an interface to extract the current id, can be numeric only

Returns

integer —

The id as fixed value

Name()

Name(): string

Expose the user name

Returns

string —

The name of this user

ToPlainObject()

ToPlainObject(string  $language = null,boolean  $withparent = true): Object

Convert to plain data set

Translate and expose the current data attribute as plain resolved object

Parameters

string $language

A system language code or empty for raw setup

boolean $withparent

When set to true the attributes will be resolved witch parent attributes included

Returns

Object —

A simple attribute based php object

Addresses()

Addresses(): array|mixed

Get the users addresses

Returns

array|mixed

PrimaryAddress()

PrimaryAddress(string  $type = 'contact',array  $data = null): mixed|null

Get primary address of certain type.

Function can set a new primary address as well

Parameters

string $type

The type of the address bill, storage, delivery

array $data

Ne data for the address

Returns

mixed|null

UpdateAttributeAlias()

UpdateAttributeAlias(object  $attr,string  $value): \FAA\Obj\Result

Called on update the alias attribute

Does a check if the alias is in use already and denies update when it is

Parameters

object $attr

The attribute definition

string $value

The new alias

Returns

\FAA\Obj\Result —

A system result object

UpdateAttributeEmailaddress()

UpdateAttributeEmailaddress(object  $attr,string  $value): \FAA\Obj\Result

Called on update the email attribute

Does a check if the alias is in use already and denies update when it is

Parameters

object $attr

The attribute definition

string $value

The new email address

Returns

\FAA\Obj\Result —

A system result object

UpdateAttributeGroups()

UpdateAttributeGroups(object  $attr,array  $value): \FAA\Obj\Result

Called on update the groups attribute

Does a check if the current user is allowed to do this change

Parameters

object $attr

The attribute definition

array $value

The new set of groups

Returns

\FAA\Obj\Result —

A system result object

Subscriptions()

Subscriptions(): array

Load list of subscriptions

Fetches the value directly from the set of attributes and returns an default empty array on demand

Returns

array

ResolvedSubscriptions()

ResolvedSubscriptions(): array

Get the list of subscription articles

Returns

array —

The list of subscription ids with type

AddSubscription()

AddSubscription(integer  $id,string  $type,null  $date = null): \FAA\Obj\Result

Add a certain subscription item

When the subscription is present already, do not add but reactivate at current date

Parameters

integer $id

The id of the lesson

string $type

The type of lesson

null $date

When given, the registration date

Returns

\FAA\Obj\Result —

A system result

ExternalReference()

ExternalReference(string  $type): mixed|null

Get certain external reference

Parameters

string $type

The id

Returns

mixed|null

RemoveExternalReference()

RemoveExternalReference(string  $type): \FAA\Obj\Result

Remove the external reference

Parameters

string $type

The type of the reference, is an id

Returns

\FAA\Obj\Result

ExternalReferences()

ExternalReferences(): array

Get the external references

Load the list to external references like facebook

Returns

array

SetExternalReference()

SetExternalReference(string  $type,string  $ext_id,string  $ext_account_id = null): \FAA\Obj\Result

Add or update existing external reference

Parameters

string $type

The provider type

string $ext_id

The external id

string $ext_account_id

Additional external id

Returns

\FAA\Obj\Result —

A system result

UnlinkSubscriptionBasket()

UnlinkSubscriptionBasket(boolean  $skip_transition = false): \FAA\Obj\Result

Unlink the subscription basket

Parameters

boolean $skip_transition

Returns

\FAA\Obj\Result

MarkSubscriptionForTermination()

MarkSubscriptionForTermination(): \FAA\Obj\Result

Set an subscription to expire in teh future

Depending on the included subscription article the basket will be processed and the transition will be defined in the extra field of the users assignment context

Returns

\FAA\Obj\Result —

A result object

MarkSubscriptionForSwitch()

MarkSubscriptionForSwitch(\FAA\Obj\Generic\Basket  $basket): \FAA\Obj\Result

Mark this as option to migrate to another basket on demand

Parameters

\FAA\Obj\Generic\Basket $basket

Returns

\FAA\Obj\Result

SetSubscriptionBasket()

SetSubscriptionBasket(integer  $id): \FAA\Obj\Result

Set the active subscription basket of this account

Parameters

integer $id

The subscription basket id

Returns

\FAA\Obj\Result —

The save result

GetSubscriptionBasket()

GetSubscriptionBasket(): \FAA\Obj\Generic\Basket|null

Get active subscription basket

Load the current linked basket for subscription verification. Will return null when no object is linked or could be loaded by version.

Returns

\FAA\Obj\Generic\Basket|null

ActiveSubscriptions()

ActiveSubscriptions(boolean  $resolved = false): array<mixed,string>|array<mixed,\FAA\Obj\Generic\BaseLesson>

Load list of active subscriptions

Fetches all currently valid and active subscription ids

Parameters

boolean $resolved

Returns

array<mixed,string>|array<mixed,\FAA\Obj\Generic\BaseLesson>

SearchFields()

SearchFields(): array

Return search indexer fields

Convert instance to search indexer values

Returns

array —

The search indexer fields

GetCompanyRoles()

GetCompanyRoles(): array

Get resolved roles

Get a list of resolved company role entries

Returns

array —

The resolved role rights

GetCompany()

GetCompany(): integer

Get company id Get the company id from content

Returns

integer —

The content id

GetCompanyObject()

GetCompanyObject(): \FAA\Obj\Generic\Company

Get company

Get the main company from content

Returns

\FAA\Obj\Generic\Company —

A company object or null when list is empty

GetMobileDevices()

GetMobileDevices(boolean  $only_active = false): array

Get list of mobile devices that are connected to this profile

Parameters

boolean $only_active

Only the active ones

Returns

array

AddMobileDevice()

AddMobileDevice(array  $data,boolean  $update_existing = false): \FAA\Obj\Result

Add mobile device

This function adds a mobile device to the profile When defined it can update existing device with the new data

Parameters

array $data

The new device data

boolean $update_existing

When true an existing device will be replaced

Returns

\FAA\Obj\Result —

A system result object

GetVisitCard()

GetVisitCard(): \JeroenDesloovere\VCard\VCard

Create this users visit card

Returns

\JeroenDesloovere\VCard\VCard

GetLinkedEmployees()

GetLinkedEmployees(): array

Get employee profiles

Get the list of linked employee profiles of this customer/user profile

Returns

array —

List with profile ids

CheckPermissionChangeAssignedGroups()

CheckPermissionChangeAssignedGroups(array  $groups): \FAA\Obj\Result

Check permission for groups

test if the given groups have a level lower the admins level and deny access when level exceeded

Parameters

array $groups

A list of user group id's

Returns

\FAA\Obj\Result —

True or false when level exceeded

GetMaximumAccessLevel()

GetMaximumAccessLevel(): integer

Get access level maximum

Parse the groups of this user account and find the maximum access level

Returns

integer —

the highest found level

Delete()

Delete(boolean  $skip = false): \FAA\Obj\Result

Delete a whole user account

this method can delete each user account except the root user

Parameters

boolean $skip

Skip hooks on demand

Returns

\FAA\Obj\Result —

A default system result set

Save()

Save(boolean  $force_new_id = false): \FAA\Obj\Result

save object entry in file system and git repository store the current payload inside the system storage and commit the changes to the local repository

Parameters

boolean $force_new_id

Indicate force new id on demand (local id empty)

Returns

\FAA\Obj\Result —

A default system result set

IsActive()

IsActive(): boolean

Check is active state

Check if the user is active and valid at the current time

Returns

boolean —

User is active

GetDefaultLanguage()

GetDefaultLanguage(): string|null

Get default language

Get the default language code of the user attribute set

Returns

string|null

GetTimeZone()

GetTimeZone(): string

Get the time zone

Returns

string

GetGroupIds()

GetGroupIds(): array

Get groups

Get a list of assigned group ids for this user

Returns

array —

The available group ids

IsRoot()

IsRoot(): boolean

User is root

Check if this is the absolute root user

Returns

boolean —

Is?

notifyOnStatusChange()

notifyOnStatusChange(  $action): \FAA\Obj\Result

Send a status transition email to this user

Parameters

$action

Returns

\FAA\Obj\Result