Constants

L_OK

L_OK = 0

L_REMARK

L_REMARK = 4

L_WARN

L_WARN = 32

L_ERROR

L_ERROR = 256

SB_TOKENSTATUS_VALID

SB_TOKENSTATUS_VALID = 0

SB_TOKENSTATUS_PARTIALLY_REDEEMED

SB_TOKENSTATUS_PARTIALLY_REDEEMED = 1

SB_TOKENSTATUS_REDEEMED

SB_TOKENSTATUS_REDEEMED = 2

SB_TOKENSTATUS_EXPIRED

SB_TOKENSTATUS_EXPIRED = 3

SB_TOKENSTATUS_INVALID

SB_TOKENSTATUS_INVALID = 4

Properties

$identifier

$identifier : 

row ID in the database pertaining to this invitation. 0 on invalid invitations.

Type

$profile

$profile : 

The profile this invitation belongs to. 0 on invalid invitations.

Type

$userId

$userId : 

The user this invitation was created for (integer DB ID). 0 on invalid invitations.

Type

$invitationTokenString

$invitationTokenString : 

Type

$invitationTokenStatus

$invitationTokenStatus : 

Type

$expiry

$expiry : 

Expiry timestamp of invitation token. 2000-01-01 00:00:00 on invalid invitations.

Type

$activationsTotal

$activationsTotal : 

How many devices were allowed to be activated in total? 0 on invalid invitations.

Type

$activationsRemaining

$activationsRemaining : 

How many devices have not yet been activated? 0 on invalid invitations.

Type

$associatedCertificates

$associatedCertificates : mixed|string|int

Type

mixed|string|int —

Methods

__construct()

__construct( invitationId) : 

initialise the entity.

Logs the start of lifetime of the entity to the debug log on levels 3 and higher.

Parameters

invitationId

Returns

__destruct()

__destruct() : 

destroys the entity.

Logs the end of lifetime of the entity to the debug log on level 5.

Returns

getAttributeValue()

getAttributeValue(mixed|string|int  attributeArray, string|int  index1, string|int  index2) : 

This is a helper fuction to retrieve a value from two-dimensional arrays The function tests if the value for the first indes is defined and then the same with the second and finally returns the value if something on the way is not defined, NULL is returned

Parameters

mixed|string|int attributeArray
string|int index1
string|int index2

Returns

createTemporaryDirectory()

createTemporaryDirectory(  purpose = installer,   failIsFatal = 1) : mixed|string|int

create a temporary directory and return the location

Parameters

purpose

one of 'installer', 'logo', 'test' defined the purpose of the directory

failIsFatal

decides if a creation failure should cause an error; defaults to true

Returns

mixed|string|int —

the tuple of: base path, absolute path for directory, directory name

rrmdir()

rrmdir(  dir) : 

this direcory delete function has been copied from PHP documentation

Parameters

dir

name of the directory to delete

Returns

uuid()

uuid(  prefix,  deterministicSource = NULL) : 

generates a UUID, for the devices which identify file contents by UUID

Parameters

prefix

an extra prefix to set before the UUID

deterministicSource

Returns

UUID (possibly prefixed)

randomString()

randomString(  length,   keyspace = 23456789abcdefghijkmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ) : 

produces a random string

Parameters

length

the length of the string to produce

keyspace

the pool of characters to use for producing the string

Throws

\Exception

Returns

link()

link() : 

Returns

invitationMailSubject()

invitationMailSubject() : 

returns the subject to use in an invitation mail

Returns

invitationMailBody()

invitationMailBody() : 

returns the body to use in an invitation mail

Returns

createInvitation()

createInvitation(  profileId,   userId,   activationCount) : 

creates a new invitation in the database

Parameters

profileId
userId
activationCount

Returns

revokeInvitation()

revokeInvitation() : 

revokes an invitation

Returns

sendBySms()

sendBySms(  number) : 

Parameters

number

the number to send to

Returns

an OutsideComm constant indicating how the sending went

sendByMail()

sendByMail( properEmail) : 

Parameters

properEmail

Returns