Member
extends ManagedModel
in package
implements
IEntity, IFederatedUser, IDeserializable, IQueryRow, JsonSerializable
Uses
TArrayTools, TDeserialize
Class Member
Interfaces, Classes, Traits and Enums
- IEntity
- Interface IMemberships
- IFederatedUser
- Interface IFederatedUser
- IDeserializable
- IQueryRow
- Interface IQueryRow
- JsonSerializable
Table of Contents
- ALLOWING_ALL_TYPES = 31
- APP_CIRCLES = 10001
- APP_DEFAULT = 11000
- APP_OCC = 10002
- ID_LENGTH = 31
- LEVEL_ADMIN = 8
- LEVEL_MEMBER = 1
- LEVEL_MODERATOR = 4
- LEVEL_NONE = 0
- LEVEL_OWNER = 9
- STATUS_BLOCKED = 'Blocked'
- STATUS_INVITED = 'Invited'
- Note: When editing those values, update lib/Application/Capabilities.php
- STATUS_MEMBER = 'Member'
- STATUS_REQUEST = 'Requesting'
- TYPE_APP = 10000
- TYPE_CIRCLE = 16
- TYPE_CONTACT = 8
- TYPE_GROUP = 2
- TYPE_MAIL = 4
- TYPE_SINGLE = 0
- TYPE_USER = 1
- $DEF_LEVEL : array<string|int, mixed>
- Note: When editing those values, update lib/Application/Capabilities.php
- $DEF_TYPE_MAX : mixed
- $TYPE : mixed
- $TYPE_ARRAY : mixed
- $TYPE_BOOLEAN : mixed
- $TYPE_INTEGER : mixed
- $TYPE_NULL : mixed
- $TYPE_SERIALIZABLE : mixed
- $TYPE_STRING : mixed
- $basedOn : Circle
- $circle : Circle
- $circleId : string
- $contactId : string
- $contactMeta : string
- $displayName : string
- $displayUpdate : int
- $id : string
- $inheritanceFrom : Member
- $inheritedBy : FederatedUser
- $instance : string
- $invitedBy : FederatedUser
- $joined : int
- $level : int
- $local : bool
- $memberships : array<string|int, Membership>
- $modelManager : ModelManager
- $notes : array<string|int, mixed>
- $remoteInstance : RemoteInstance
- $singleId : string
- $status : string
- $userId : string
- $userType : int
- __construct() : mixed
- Member constructor.
- compareWith() : bool
- deserialize() : IDeserializable
- deserializeArray() : array<string|int, IDeserializable>
- deserializeJson() : IDeserializable
- deserializeList() : array<string|int, IDeserializable>
- getBasedOn() : Circle
- getCircle() : Circle
- getCircleId() : string
- getContactId() : string
- getContactMeta() : string
- getDisplayName() : string
- getDisplayUpdate() : int
- getId() : string
- getInheritanceFrom() : Member|null
- getInheritedBy() : FederatedUser
- getInstance() : string
- getInvitedBy() : FederatedUser
- getJoined() : int
- getLevel() : int
- getLink() : Membership
- getMembership() : Membership
- getMemberships() : array<string|int, Membership>
- getNote() : string
- getNoteArray() : array<string|int, mixed>
- getNotes() : array<string|int, mixed>
- getRemoteInstance() : RemoteInstance
- getSingleId() : string
- getStatus() : string
- getType() : int
- getUserId() : string
- getUserType() : int
- hasBasedOn() : bool
- hasCircle() : bool
- hasInheritanceFrom() : bool
- hasInheritedBy() : bool
- hasInvitedBy() : bool
- hasMemberships() : bool
- hasRemoteInstance() : bool
- import() : $this
- importFromDatabase() : IQueryRow
- import data to feed the model.
- importFromIFederatedUser() : void
- isLocal() : bool
- jsonSerialize() : array<string|int, string>
- parseLevelInt() : int
- parseLevelString() : int
- parseTypeString() : int
- serialize() : array<string|int, mixed>
- serializeArray() : array<string|int, mixed>
- setBasedOn() : $this
- setCircle() : self
- setCircleId() : Member
- setContactId() : Member
- setContactMeta() : Member
- setDisplayName() : Member
- setDisplayUpdate() : Member
- setId() : $this
- setInheritanceFrom() : $this
- setInheritedBy() : $this
- setInstance() : Member
- setInvitedBy() : Member
- setJoined() : Member
- setLevel() : Member
- setMemberships() : self
- setNote() : $this
- setNoteArray() : $this
- setNoteObj() : $this
- setNotes() : Member
- setRemoteInstance() : Member
- setSingleId() : $this
- This should replace user_id, user_type and instance; and will use the data from Circle with Config=CFG_SINGLE
- setStatus() : Member
- setUserId() : Member
- setUserType() : Member
- typeOf() : string
- validKey() : bool
- cleanArray() : mixed
- extractArray() : mixed
- get() : string
- getArray() : array<string|int, mixed>
- getBool() : bool
- getFloat() : float
- getInt() : int
- getList() : array<string|int, mixed>
- getManager() : ModelManager
- getObj() : mixed
- mustContains() : mixed
Constants
ALLOWING_ALL_TYPES
public
mixed
ALLOWING_ALL_TYPES
= 31
APP_CIRCLES
public
mixed
APP_CIRCLES
= 10001
APP_DEFAULT
public
mixed
APP_DEFAULT
= 11000
APP_OCC
public
mixed
APP_OCC
= 10002
ID_LENGTH
public
mixed
ID_LENGTH
= 31
LEVEL_ADMIN
public
mixed
LEVEL_ADMIN
= 8
LEVEL_MEMBER
public
mixed
LEVEL_MEMBER
= 1
LEVEL_MODERATOR
public
mixed
LEVEL_MODERATOR
= 4
LEVEL_NONE
public
mixed
LEVEL_NONE
= 0
LEVEL_OWNER
public
mixed
LEVEL_OWNER
= 9
STATUS_BLOCKED
public
mixed
STATUS_BLOCKED
= 'Blocked'
STATUS_INVITED
Note: When editing those values, update lib/Application/Capabilities.php
public
mixed
STATUS_INVITED
= 'Invited'
Tags
STATUS_MEMBER
public
mixed
STATUS_MEMBER
= 'Member'
STATUS_REQUEST
public
mixed
STATUS_REQUEST
= 'Requesting'
TYPE_APP
public
mixed
TYPE_APP
= 10000
TYPE_CIRCLE
public
mixed
TYPE_CIRCLE
= 16
TYPE_CONTACT
public
mixed
TYPE_CONTACT
= 8
TYPE_GROUP
public
mixed
TYPE_GROUP
= 2
TYPE_MAIL
public
mixed
TYPE_MAIL
= 4
TYPE_SINGLE
public
mixed
TYPE_SINGLE
= 0
TYPE_USER
public
mixed
TYPE_USER
= 1
Properties
$DEF_LEVEL
Note: When editing those values, update lib/Application/Capabilities.php
public
static array<string|int, mixed>
$DEF_LEVEL
= [1 => 'Member', 4 => 'Moderator', 8 => 'Admin', 9 => 'Owner']
Tags
$DEF_TYPE_MAX
public
static mixed
$DEF_TYPE_MAX
= 31
$TYPE
public
static mixed
$TYPE
= [0 => 'single', 1 => 'user', 2 => 'group', 4 => 'mail', 8 => 'contact', 16 => 'circle', 10000 => 'app']
$TYPE_ARRAY
public
static mixed
$TYPE_ARRAY
= 'Array'
$TYPE_BOOLEAN
public
static mixed
$TYPE_BOOLEAN
= 'Boolean'
$TYPE_INTEGER
public
static mixed
$TYPE_INTEGER
= 'Integer'
$TYPE_NULL
public
static mixed
$TYPE_NULL
= 'Null'
$TYPE_SERIALIZABLE
public
static mixed
$TYPE_SERIALIZABLE
= 'Serializable'
$TYPE_STRING
public
static mixed
$TYPE_STRING
= 'String'
$basedOn
private
Circle
$basedOn
$circle
private
Circle
$circle
$circleId
private
string
$circleId
= ''
$contactId
private
string
$contactId
= ''
$contactMeta
private
string
$contactMeta
= ''
$displayName
private
string
$displayName
= ''
$displayUpdate
private
int
$displayUpdate
= 0
$id
private
string
$id
= ''
$inheritanceFrom
private
Member
$inheritanceFrom
$inheritedBy
private
FederatedUser
$inheritedBy
$instance
private
string
$instance
= ''
$invitedBy
private
FederatedUser
$invitedBy
$joined
private
int
$joined
= 0
$level
private
int
$level
= 0
$local
private
bool
$local
= false
$memberships
private
array<string|int, Membership>
$memberships
= null
$modelManager
private
ModelManager
$modelManager
$notes
private
array<string|int, mixed>
$notes
= []
$remoteInstance
private
RemoteInstance
$remoteInstance
$singleId
private
string
$singleId
= ''
$status
private
string
$status
= 'Unknown'
$userId
private
string
$userId
= ''
$userType
private
int
$userType
= 0
Methods
__construct()
Member constructor.
public
__construct() : mixed
Return values
mixed —compareWith()
public
compareWith(Member $member[, bool $full = true ]) : bool
Parameters
- $member : Member
- $full : bool = true
Return values
bool —deserialize()
public
deserialize(array<string|int, mixed> $data, string $class) : IDeserializable
Parameters
- $data : array<string|int, mixed>
- $class : string
Tags
Return values
IDeserializable —deserializeArray()
public
deserializeArray(array<string|int, mixed> $data, string $class[, bool $associative = false ]) : array<string|int, IDeserializable>
Parameters
- $data : array<string|int, mixed>
- $class : string
- $associative : bool = false
Return values
array<string|int, IDeserializable> —deserializeJson()
public
deserializeJson(string $json, string $class) : IDeserializable
Parameters
- $json : string
- $class : string
Tags
Return values
IDeserializable —deserializeList()
public
deserializeList(string $json, string $class) : array<string|int, IDeserializable>
Parameters
- $json : string
- $class : string
Tags
Return values
array<string|int, IDeserializable> —getBasedOn()
public
getBasedOn() : Circle
Return values
Circle —getCircle()
public
getCircle() : Circle
Return values
Circle —getCircleId()
public
getCircleId() : string
Return values
string —getContactId()
public
getContactId() : string
Return values
string —getContactMeta()
public
getContactMeta() : string
Return values
string —getDisplayName()
public
getDisplayName() : string
Return values
string —getDisplayUpdate()
public
getDisplayUpdate() : int
Return values
int —getId()
public
getId() : string
Return values
string —getInheritanceFrom()
public
getInheritanceFrom() : Member|null
Return values
Member|null —getInheritedBy()
public
getInheritedBy() : FederatedUser
Return values
FederatedUser —getInstance()
public
getInstance() : string
Return values
string —getInvitedBy()
public
getInvitedBy() : FederatedUser
Return values
FederatedUser —getJoined()
public
getJoined() : int
Return values
int —getLevel()
public
getLevel() : int
Return values
int —getLink()
public
getLink(string $singleId[, bool $detailed = false ]) : Membership
Parameters
- $singleId : string
- $detailed : bool = false
Tags
Return values
Membership —getMembership()
public
getMembership(string $circleId[, bool $detailed = false ]) : Membership
Parameters
- $circleId : string
- $detailed : bool = false
Tags
Return values
Membership —getMemberships()
public
getMemberships() : array<string|int, Membership>
Return values
array<string|int, Membership> —getNote()
public
getNote(string $key) : string
Parameters
- $key : string
Return values
string —getNoteArray()
public
getNoteArray(string $key) : array<string|int, mixed>
Parameters
- $key : string
Return values
array<string|int, mixed> —getNotes()
public
getNotes() : array<string|int, mixed>
Return values
array<string|int, mixed> —getRemoteInstance()
public
getRemoteInstance() : RemoteInstance
Return values
RemoteInstance —getSingleId()
public
getSingleId() : string
Return values
string —getStatus()
public
getStatus() : string
Return values
string —getType()
public
getType() : int
Tags
Return values
int —getUserId()
public
getUserId() : string
Return values
string —getUserType()
public
getUserType() : int
Return values
int —hasBasedOn()
public
hasBasedOn() : bool
Return values
bool —hasCircle()
public
hasCircle() : bool
Return values
bool —hasInheritanceFrom()
public
hasInheritanceFrom() : bool
Return values
bool —hasInheritedBy()
public
hasInheritedBy() : bool
Return values
bool —hasInvitedBy()
public
hasInvitedBy() : bool
Return values
bool —hasMemberships()
public
hasMemberships() : bool
Return values
bool —hasRemoteInstance()
public
hasRemoteInstance() : bool
Return values
bool —import()
public
import(array<string|int, mixed> $data) : $this
Parameters
- $data : array<string|int, mixed>
Tags
Return values
$this —importFromDatabase()
import data to feed the model.
public
importFromDatabase(array<string|int, mixed> $data[, string $prefix = '' ]) : IQueryRow
Parameters
- $data : array<string|int, mixed>
- $prefix : string = ''
Tags
Return values
IQueryRow —importFromIFederatedUser()
public
importFromIFederatedUser(IFederatedUser $orig) : void
Parameters
- $orig : IFederatedUser
Tags
Return values
void —isLocal()
public
isLocal() : bool
Return values
bool —jsonSerialize()
public
jsonSerialize() : array<string|int, string>
Tags
Return values
array<string|int, string> —parseLevelInt()
public
static parseLevelInt(int $level) : int
Parameters
- $level : int
Tags
Return values
int —parseLevelString()
public
static parseLevelString(string $levelString) : int
Parameters
- $levelString : string
Tags
Return values
int —parseTypeString()
public
static parseTypeString(string $typeString) : int
Parameters
- $typeString : string
Tags
Return values
int —serialize()
public
serialize(JsonSerializable $model) : array<string|int, mixed>
Parameters
- $model : JsonSerializable
Return values
array<string|int, mixed> —serializeArray()
public
serializeArray(array<string|int, mixed> $data) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed>
Return values
array<string|int, mixed> —setBasedOn()
public
setBasedOn(Circle $basedOn) : $this
Parameters
- $basedOn : Circle
Return values
$this —setCircle()
public
setCircle(Circle $circle) : self
Parameters
- $circle : Circle
Return values
self —setCircleId()
public
setCircleId(string $circleId) : Member
Parameters
- $circleId : string
Return values
Member —setContactId()
public
setContactId(string $contactId) : Member
Parameters
- $contactId : string
Return values
Member —setContactMeta()
public
setContactMeta(string $contactMeta) : Member
Parameters
- $contactMeta : string
Return values
Member —setDisplayName()
public
setDisplayName(string $displayName) : Member
Parameters
- $displayName : string
Return values
Member —setDisplayUpdate()
public
setDisplayUpdate(int $displayUpdate) : Member
Parameters
- $displayUpdate : int
Return values
Member —setId()
public
setId(string $id) : $this
Parameters
- $id : string
Return values
$this —setInheritanceFrom()
public
setInheritanceFrom(Member $inheritanceFrom) : $this
Parameters
- $inheritanceFrom : Member
Return values
$this —setInheritedBy()
public
setInheritedBy(FederatedUser $inheritedBy) : $this
Parameters
- $inheritedBy : FederatedUser
Return values
$this —setInstance()
public
setInstance(string $instance) : Member
Parameters
- $instance : string
Return values
Member —setInvitedBy()
public
setInvitedBy(FederatedUser $invitedBy) : Member
Parameters
- $invitedBy : FederatedUser
Return values
Member —setJoined()
public
setJoined(int $joined) : Member
Parameters
- $joined : int
Return values
Member —setLevel()
public
setLevel(int $level) : Member
Parameters
- $level : int
Return values
Member —setMemberships()
public
setMemberships(array<string|int, mixed> $memberships) : self
Parameters
- $memberships : array<string|int, mixed>
Return values
self —setNote()
public
setNote(string $key, string $note) : $this
Parameters
- $key : string
- $note : string
Return values
$this —setNoteArray()
public
setNoteArray(string $key, array<string|int, mixed> $note) : $this
Parameters
- $key : string
- $note : array<string|int, mixed>
Return values
$this —setNoteObj()
public
setNoteObj(string $key, JsonSerializable $obj) : $this
Parameters
- $key : string
- $obj : JsonSerializable
Return values
$this —setNotes()
public
setNotes(array<string|int, mixed> $notes) : Member
Parameters
- $notes : array<string|int, mixed>
Return values
Member —setRemoteInstance()
public
setRemoteInstance(RemoteInstance $remoteInstance) : Member
Parameters
- $remoteInstance : RemoteInstance
Return values
Member —setSingleId()
This should replace user_id, user_type and instance; and will use the data from Circle with Config=CFG_SINGLE
public
setSingleId(string $singleId) : $this
Parameters
- $singleId : string
Return values
$this —setStatus()
public
setStatus(string $status) : Member
Parameters
- $status : string
Return values
Member —setUserId()
public
setUserId(string $userId) : Member
Parameters
- $userId : string
Return values
Member —setUserType()
public
setUserType(int $userType) : Member
Parameters
- $userType : int
Return values
Member —typeOf()
public
typeOf(string $key, array<string|int, mixed> $arr[, bool $root = true ]) : string
Parameters
- $key : string
- $arr : array<string|int, mixed>
- $root : bool = true
Tags
Return values
string —validKey()
public
validKey(string $k, array<string|int, mixed> $arr) : bool
Parameters
- $k : string
- $arr : array<string|int, mixed>
Return values
bool —cleanArray()
protected
cleanArray(array<string|int, mixed> &$arr) : mixed
Parameters
- $arr : array<string|int, mixed>
Return values
mixed —extractArray()
protected
extractArray(string $k, string $value, array<string|int, mixed> $list) : mixed
Parameters
- $k : string
- $value : string
- $list : array<string|int, mixed>
Tags
Return values
mixed —get()
protected
get(string $k, array<string|int, mixed> $arr[, string $default = '' ]) : string
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : string = ''
Return values
string —getArray()
protected
getArray(string $k, array<string|int, mixed> $arr[, array<string|int, mixed> $default = [] ]) : array<string|int, mixed>
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : array<string|int, mixed> = []
Return values
array<string|int, mixed> —getBool()
protected
getBool(string $k, array<string|int, mixed> $arr[, bool $default = false ]) : bool
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : bool = false
Return values
bool —getFloat()
protected
getFloat(string $k, array<string|int, mixed> $arr, float $default) : float
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : float
Return values
float —getInt()
protected
getInt(string $k, array<string|int, mixed> $arr, int $default) : int
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : int
Return values
int —getList()
protected
getList(string $k, array<string|int, mixed> $arr, array<string|int, mixed> $import[, array<string|int, mixed> $default = [] ]) : array<string|int, mixed>
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $import : array<string|int, mixed>
- $default : array<string|int, mixed> = []
Return values
array<string|int, mixed> —getManager()
protected
getManager() : ModelManager
Return values
ModelManager —getObj()
protected
getObj(string $k, array<string|int, mixed> $arr[, JsonSerializable|null $default = null ]) : mixed
Parameters
- $k : string
- $arr : array<string|int, mixed>
- $default : JsonSerializable|null = null
Return values
mixed —mustContains()
protected
mustContains(array<string|int, mixed> $keys, array<string|int, mixed> $arr) : mixed
Parameters
- $keys : array<string|int, mixed>
- $arr : array<string|int, mixed>