core/model/modx/sqlsrv/moduser.class.php
- Package
- modx
- Subpackage
- sqlsrv
\modUser_sqlsrv
The core MODX user class.
{@internal Implement a derivative to define the behavior and attributes of an actual user or system that is intended to access modX or a modX service.}
- Parent(s)
- \modUser < \modPrincipal < \xPDOSimpleObject < \xPDOObject
Properties
array
$_aggregates= 'array ()'
An array of aggregate foreign key relationships for the class.
Inherited from: \xPDOObject::$$_aggregates\xPDOSimpleObject::$$_aggregates\modPrincipal::$$_aggregates\modUser::$$_aggregatesarray ()
Details- Type
- array
- Access
- public
- Inherited_from
- \xPDOObject::$$_aggregates
- Inherited_from
- \xPDOSimpleObject::$$_aggregates
- Inherited_from
- \modPrincipal::$$_aggregates
- Inherited_from
- \modUser::$$_aggregates
string
$_alias= 'null'
An alias for this instance of the class.
Inherited from: \xPDOObject::$$_alias\xPDOSimpleObject::$$_alias\modPrincipal::$$_alias\modUser::$$_aliasnull
Details- Type
- string
- Inherited_from
- \xPDOObject::$$_alias
- Inherited_from
- \xPDOSimpleObject::$$_alias
- Inherited_from
- \modPrincipal::$$_alias
- Inherited_from
- \modUser::$$_alias
array
$_attributes= 'null'
Stores a collection of key-value pairs identifying policy authority.
Inherited from: \modPrincipal::$$_attributes\modUser::$$_attributesnull
Details- Type
- array
- Access
- protected
- Inherited_from
- \modPrincipal::$$_attributes
- Inherited_from
- \modUser::$$_attributes
boolean
$_cacheFlag= 'true'
Indicates the cacheability of the instance.
Inherited from: \xPDOObject::$$_cacheFlag\xPDOSimpleObject::$$_cacheFlag\modPrincipal::$$_cacheFlag\modUser::$$_cacheFlagtrue
Details- Type
- boolean
- Inherited_from
- \xPDOObject::$$_cacheFlag
- Inherited_from
- \xPDOSimpleObject::$$_cacheFlag
- Inherited_from
- \modPrincipal::$$_cacheFlag
- Inherited_from
- \modUser::$$_cacheFlag
string
$_class= 'null'
The actual class name of an instance.
Inherited from: \xPDOObject::$$_class\xPDOSimpleObject::$$_class\modPrincipal::$$_class\modUser::$$_classnull
Details- Type
- string
- Inherited_from
- \xPDOObject::$$_class
- Inherited_from
- \xPDOSimpleObject::$$_class
- Inherited_from
- \modPrincipal::$$_class
- Inherited_from
- \modUser::$$_class
array
$_composites= 'array ()'
An array of composite foreign key relationships for the class.
Inherited from: \xPDOObject::$$_composites\xPDOSimpleObject::$$_composites\modPrincipal::$$_composites\modUser::$$_compositesarray ()
Details- Type
- array
- Access
- public
- Inherited_from
- \xPDOObject::$$_composites
- Inherited_from
- \xPDOSimpleObject::$$_composites
- Inherited_from
- \modPrincipal::$$_composites
- Inherited_from
- \modUser::$$_composites
array
$_dirty= 'array ()'
An array of field names that have been modified.
Inherited from: \xPDOObject::$$_dirty\xPDOSimpleObject::$$_dirty\modPrincipal::$$_dirty\modUser::$$_dirtyarray ()
Details- Type
- array
- Access
- public
- Inherited_from
- \xPDOObject::$$_dirty
- Inherited_from
- \xPDOSimpleObject::$$_dirty
- Inherited_from
- \modPrincipal::$$_dirty
- Inherited_from
- \modUser::$$_dirty
array
$_fieldAliases= 'array()'
An optional array of field aliases.
Inherited from: \xPDOObject::$$_fieldAliases\xPDOSimpleObject::$$_fieldAliases\modPrincipal::$$_fieldAliases\modUser::$$_fieldAliasesarray()
Details- Type
- array
- Inherited_from
- \xPDOObject::$$_fieldAliases
- Inherited_from
- \xPDOSimpleObject::$$_fieldAliases
- Inherited_from
- \modPrincipal::$$_fieldAliases
- Inherited_from
- \modUser::$$_fieldAliases
array
$_fieldMeta= 'array ()'
An array of metadata definitions for each field in the class.
Inherited from: \xPDOObject::$$_fieldMeta\xPDOSimpleObject::$$_fieldMeta\modPrincipal::$$_fieldMeta\modUser::$$_fieldMetaarray ()
Details- Type
- array
- Access
- public
- Inherited_from
- \xPDOObject::$$_fieldMeta
- Inherited_from
- \xPDOSimpleObject::$$_fieldMeta
- Inherited_from
- \modPrincipal::$$_fieldMeta
- Inherited_from
- \modUser::$$_fieldMeta
array
$_fields= 'array ()'
An array of key-value pairs representing the fields of the instance.
Inherited from: \xPDOObject::$$_fields\xPDOSimpleObject::$$_fields\modPrincipal::$$_fields\modUser::$$_fieldsarray ()
Details- Type
- array
- Access
- public
- Inherited_from
- \xPDOObject::$$_fields
- Inherited_from
- \xPDOSimpleObject::$$_fields
- Inherited_from
- \modPrincipal::$$_fields
- Inherited_from
- \modUser::$$_fields
array
$_lazy= 'array ()'
An array of field names that have not been loaded from the source.
Inherited from: \xPDOObject::$$_lazy\xPDOSimpleObject::$$_lazy\modPrincipal::$$_lazy\modUser::$$_lazyarray ()
Details- Type
- array
- Access
- public
- Inherited_from
- \xPDOObject::$$_lazy
- Inherited_from
- \xPDOSimpleObject::$$_lazy
- Inherited_from
- \modPrincipal::$$_lazy
- Inherited_from
- \modUser::$$_lazy
boolean
$_new= 'true'
Indicates if the instance is transient (and thus new).
Inherited from: \xPDOObject::$$_new\xPDOSimpleObject::$$_new\modPrincipal::$$_new\modUser::$$_newtrue
Details- Type
- boolean
- Access
- public
- Inherited_from
- \xPDOObject::$$_new
- Inherited_from
- \xPDOSimpleObject::$$_new
- Inherited_from
- \modPrincipal::$$_new
- Inherited_from
- \modUser::$$_new
array
$_options= 'array()'
A collection of various options that can be used on the instance.
Inherited from: \xPDOObject::$$_options\xPDOSimpleObject::$$_options\modPrincipal::$$_options\modUser::$$_optionsarray()
Details- Type
- array
- Inherited_from
- \xPDOObject::$$_options
- Inherited_from
- \xPDOSimpleObject::$$_options
- Inherited_from
- \modPrincipal::$$_options
- Inherited_from
- \modUser::$$_options
string
$_package= 'null'
The package the class is a part of.
Inherited from: \xPDOObject::$$_package\xPDOSimpleObject::$$_package\modPrincipal::$$_package\modUser::$$_packagenull
Details- Type
- string
- Inherited_from
- \xPDOObject::$$_package
- Inherited_from
- \xPDOSimpleObject::$$_package
- Inherited_from
- \modPrincipal::$$_package
- Inherited_from
- \modUser::$$_package
string|array
$_pk= 'null'
The primary key field (or an array of primary key fields) for this object.
Inherited from: \xPDOObject::$$_pk\xPDOSimpleObject::$$_pk\modPrincipal::$$_pk\modUser::$$_pknull
Details- Type
- string | array
- Access
- public
- Inherited_from
- \xPDOObject::$$_pk
- Inherited_from
- \xPDOSimpleObject::$$_pk
- Inherited_from
- \modPrincipal::$$_pk
- Inherited_from
- \modUser::$$_pk
string|array
$_pktype= 'null'
The php native type of the primary key field.
Inherited from: \xPDOObject::$$_pktype\xPDOSimpleObject::$$_pktype\modPrincipal::$$_pktype\modUser::$$_pktypeNOTE: Will be an array if multiple primary keys are specified for the object.
null
Details- Type
- string | array
- Access
- public
- Inherited_from
- \xPDOObject::$$_pktype
- Inherited_from
- \xPDOSimpleObject::$$_pktype
- Inherited_from
- \modPrincipal::$$_pktype
- Inherited_from
- \modUser::$$_pktype
array
$_relatedObjects= 'array ()'
An array of object instances related to this object instance.
Inherited from: \xPDOObject::$$_relatedObjects\xPDOSimpleObject::$$_relatedObjects\modPrincipal::$$_relatedObjects\modUser::$$_relatedObjectsarray ()
Details- Type
- array
- Access
- public
- Inherited_from
- \xPDOObject::$$_relatedObjects
- Inherited_from
- \xPDOSimpleObject::$$_relatedObjects
- Inherited_from
- \modPrincipal::$$_relatedObjects
- Inherited_from
- \modUser::$$_relatedObjects
string
$_table= 'null'
Name of the actual table representing this class.
Inherited from: \xPDOObject::$$_table\xPDOSimpleObject::$$_table\modPrincipal::$$_table\modUser::$$_tablenull
Details- Type
- string
- Access
- public
- Inherited_from
- \xPDOObject::$$_table
- Inherited_from
- \xPDOSimpleObject::$$_table
- Inherited_from
- \modPrincipal::$$_table
- Inherited_from
- \modUser::$$_table
string
$_tableMeta= 'null'
An array of meta data for the table.
Inherited from: \xPDOObject::$$_tableMeta\xPDOSimpleObject::$$_tableMeta\modPrincipal::$$_tableMeta\modUser::$$_tableMetanull
Details- Type
- string
- Access
- public
- Inherited_from
- \xPDOObject::$$_tableMeta
- Inherited_from
- \xPDOSimpleObject::$$_tableMeta
- Inherited_from
- \modPrincipal::$$_tableMeta
- Inherited_from
- \modUser::$$_tableMeta
array
$_validated= 'array ()'
An array of field names that have been already validated.
Inherited from: \xPDOObject::$$_validated\xPDOSimpleObject::$$_validated\modPrincipal::$$_validated\modUser::$$_validatedarray ()
Details- Type
- array
- Access
- public
- Inherited_from
- \xPDOObject::$$_validated
- Inherited_from
- \xPDOSimpleObject::$$_validated
- Inherited_from
- \modPrincipal::$$_validated
- Inherited_from
- \modUser::$$_validated
boolean
$_validationLoaded= 'false'
Indicates if the validation map has been loaded.
Inherited from: \xPDOObject::$$_validationLoaded\xPDOSimpleObject::$$_validationLoaded\modPrincipal::$$_validationLoaded\modUser::$$_validationLoadedfalse
Details- Type
- boolean
- Access
- public
- Inherited_from
- \xPDOObject::$$_validationLoaded
- Inherited_from
- \xPDOSimpleObject::$$_validationLoaded
- Inherited_from
- \modPrincipal::$$_validationLoaded
- Inherited_from
- \modUser::$$_validationLoaded
array
$_validationRules= 'array()'
An array of validation rules for this object instance.
Inherited from: \xPDOObject::$$_validationRules\xPDOSimpleObject::$$_validationRules\modPrincipal::$$_validationRules\modUser::$$_validationRulesarray()
Details- Type
- array
- Access
- public
- Inherited_from
- \xPDOObject::$$_validationRules
- Inherited_from
- \xPDOSimpleObject::$$_validationRules
- Inherited_from
- \modPrincipal::$$_validationRules
- Inherited_from
- \modUser::$$_validationRules
\xPDOValidator
$_validator= 'null'
A validator object responsible for this object instance.
Inherited from: \xPDOObject::$$_validator\xPDOSimpleObject::$$_validator\modPrincipal::$$_validator\modUser::$$_validatornull
Details- Type
- \xPDOValidator
- Access
- public
- Inherited_from
- \xPDOObject::$$_validator
- Inherited_from
- \xPDOSimpleObject::$$_validator
- Inherited_from
- \modPrincipal::$$_validator
- Inherited_from
- \modUser::$$_validator
string
$container= 'null'
Name of the data source container the object belongs to.
Inherited from: \xPDOObject::$$container\xPDOSimpleObject::$$container\modPrincipal::$$container\modUser::$$containernull
Details- Type
- string
- Access
- public
- Inherited_from
- \xPDOObject::$$container
- Inherited_from
- \xPDOSimpleObject::$$container
- Inherited_from
- \modPrincipal::$$container
- Inherited_from
- \modUser::$$container
array
$fieldNames= 'null'
Names of the fields in the data table, fully-qualified with a table name.
Inherited from: \xPDOObject::$$fieldNames\xPDOSimpleObject::$$fieldNames\modPrincipal::$$fieldNames\modUser::$$fieldNamesNOTE: For use in table joins to qualify fields with the same name.
null
Details- Type
- array
- Access
- public
- Inherited_from
- \xPDOObject::$$fieldNames
- Inherited_from
- \xPDOSimpleObject::$$fieldNames
- Inherited_from
- \modPrincipal::$$fieldNames
- Inherited_from
- \modUser::$$fieldNames
array
$sessionContexts= 'array ()'
A collection of contexts which the current principal is authenticated in.
Inherited from: \modUser::$$sessionContextsarray ()
Details- Type
- array
- Access
- public
- Inherited_from
- \modUser::$$sessionContexts
\xPDO
$xpdo= 'null'
A convenience reference to the xPDO object.
Inherited from: \xPDOObject::$$xpdo\xPDOSimpleObject::$$xpdo\modPrincipal::$$xpdo\modUser::$$xpdonull
Details- Type
- \xPDO
- Access
- public
- Inherited_from
- \xPDOObject::$$xpdo
- Inherited_from
- \xPDOSimpleObject::$$xpdo
- Inherited_from
- \modPrincipal::$$xpdo
- Inherited_from
- \modUser::$$xpdo
Methods
__construct(
\xPDO $xpdo
)
:
\xPDOObject
Constructor
Inherited from: \xPDOObject::__construct()\xPDOSimpleObject::__construct()\modPrincipal::__construct()\modUser::__construct()Do not call the constructor directly; see {@link xPDO::newObject()}.
All derivatives of xPDOObject must redeclare this method, and must call the parent method explicitly before any additional logic is executed, e.g.
public function __construct(xPDO & $xpdo) {
parent :: __construct($xpdo);
// Any additional constructor tasks here
}
Name | Type | Description |
---|---|---|
$xpdo | \xPDO | &$xpdo A reference to a valid xPDO instance. |
Type | Description |
---|---|
\xPDOObject |
- Access
- public
_getAliases(
string $class, int $limit
=
0
)
:
array
Find aliases for any defined object relations of the specified class.
Inherited from: \xPDOObject::_getAliases()\xPDOSimpleObject::_getAliases()\modPrincipal::_getAliases()\modUser::_getAliases()Name | Type | Description |
---|---|---|
$class | string | The name of the class to find aliases from. |
$limit | int | An optional limit on the number of aliases to return; default is 0, i.e. no limit. |
Type | Description |
---|---|
array | An array of aliases or an empty array if none are found. |
- Access
- protected
_getDataType(
string $key
)
:
string
Gets the database data type for the specified field.
Inherited from: \xPDOObject::_getDataType()\xPDOSimpleObject::_getDataType()\modPrincipal::_getDataType()\modUser::_getDataType()Name | Type | Description |
---|---|---|
$key | string | The field name to get the data type for. |
Type | Description |
---|---|
string | The DB data type of the field. |
- Access
- protected
_getPHPType(
string $key
)
:
string
Gets the php data type for the specified field.
Inherited from: \xPDOObject::_getPHPType()\xPDOSimpleObject::_getPHPType()\modPrincipal::_getPHPType()\modUser::_getPHPType()Name | Type | Description |
---|---|---|
$key | string | The field name to get the data type for. |
Type | Description |
---|---|
string | The PHP data type of the field. |
- Access
- protected
_getRelatedObjectsByFK(
string $alias, mixed $criteria
=
null, boolean | integer $cacheFlag
=
true
)
:
array
Gets related objects by a foreign key and specified criteria.
Inherited from: \xPDOObject::_getRelatedObjectsByFK()\xPDOSimpleObject::_getRelatedObjectsByFK()\modPrincipal::_getRelatedObjectsByFK()\modUser::_getRelatedObjectsByFK()Name | Type | Description |
---|---|---|
$alias | string | The alias representing the relationship. |
$criteria | mixed | An optional xPDO criteria expression. |
$cacheFlag | boolean | integer | Indicates if the saved object(s) should be cached and optionally, by specifying an integer value, for how many seconds before expiring. Overrides the cacheFlag for the object. |
Type | Description |
---|---|
array | A collection of objects matching the criteria. |
- Access
- protected
_initFields(
)
:
void
Initializes the field names with the qualified table name.
Inherited from: \xPDOObject::_initFields()\xPDOSimpleObject::_initFields()\modPrincipal::_initFields()\modUser::_initFields()Once this is called, you can lookup the qualified name by the field name itself in {@link xPDOObject::$fieldNames}.
- Access
- protected
_loadCollectionInstance(
\xPDO $xpdo, array $objCollection, string $className, mixed $criteria, $row, $fromCache, boolean | integer $cacheFlag
=
true
)
:
void
Responsible for loading an instance into a collection.
Inherited from: \xPDOObject::_loadCollectionInstance()\xPDOSimpleObject::_loadCollectionInstance()\modPrincipal::_loadCollectionInstance()\modUser::_loadCollectionInstance()Name | Type | Description |
---|---|---|
$xpdo | \xPDO | &$xpdo A valid xPDO instance. |
$objCollection | array | &$objCollection The collection to load the instance into. |
$className | string | Name of the class. |
$criteria | mixed | A valid primary key, criteria array, or xPDOCriteria instance. |
$row | ||
$fromCache | ||
$cacheFlag | boolean | integer | Indicates if the objects should be cached and optionally, by specifying an integer value, for how many seconds. |
- Static
_loadFieldData(
string | array $fields
)
:
void
Load persistent data from the source for the field(s) indicated.
Inherited from: \xPDOObject::_loadFieldData()\xPDOSimpleObject::_loadFieldData()\modPrincipal::_loadFieldData()\modUser::_loadFieldData()Name | Type | Description |
---|---|---|
$fields | string | array | A field name or array of field names to load from the data source. |
- Access
- protected
_loadInstance(
\xPDO $xpdo, string $className, \xPDOQuery | string $criteria, array $row
)
:
\xPDOObject
Loads an instance from an associative array.
Inherited from: \xPDOObject::_loadInstance()\xPDOSimpleObject::_loadInstance()\modPrincipal::_loadInstance()\modUser::_loadInstance()Name | Type | Description |
---|---|---|
$xpdo | \xPDO | &$xpdo A valid xPDO instance. |
$className | string | Name of the class. |
$criteria | \xPDOQuery | string | A valid xPDOQuery instance or relation alias. |
$row | array | The associative array containing the instance data. |
Type | Description |
---|---|
\xPDOObject | A new xPDOObject derivative representing a data row. |
- Static
_loadRows(
\xPDO $xpdo, string $className, \xPDOCriteria $criteria
)
:
\PDOStatement
Responsible for loading a result set from the database.
Inherited from: \xPDOObject::_loadRows()\xPDOSimpleObject::_loadRows()\modPrincipal::_loadRows()\modUser::_loadRows()Name | Type | Description |
---|---|---|
$xpdo | \xPDO | &$xpdo A valid xPDO instance. |
$className | string | Name of the class. |
$criteria | \xPDOCriteria | A valid xPDOCriteria instance. |
Type | Description |
---|---|
\PDOStatement | A reference to a PDOStatement representing the result set. |
- Static
_loadValidation(
boolean $reload
=
false
)
:
void
Used to load validation from the object map.
Inherited from: \xPDOObject::_loadValidation()\xPDOSimpleObject::_loadValidation()\modPrincipal::_loadValidation()\modUser::_loadValidation()Name | Type | Description |
---|---|---|
$reload | boolean | Indicates if the schema validation rules should be reloaded. |
- Access
- public
_saveRelatedObject(
\xPDOObject $obj, array $fkMeta
)
:
boolean
Save a related object with pending changes.
Inherited from: \xPDOObject::_saveRelatedObject()\xPDOSimpleObject::_saveRelatedObject()\modPrincipal::_saveRelatedObject()\modUser::_saveRelatedObject()This function is also responsible for setting foreign keys when new related objects are being saved, as well as local keys when the host object is new and needs the foreign key.
Name | Type | Description |
---|---|---|
$obj | \xPDOObject | &$obj A reference to the related object. |
$fkMeta | array | The meta data representing the relation. |
Type | Description |
---|---|
boolean | True if a related object was dirty and saved successfully. |
- Access
- protected
_saveRelatedObjects(
)
:
integer
Searches for any related objects with pending changes to save.
Inherited from: \xPDOObject::_saveRelatedObjects()\xPDOSimpleObject::_saveRelatedObjects()\modPrincipal::_saveRelatedObjects()\modUser::_saveRelatedObjects()Type | Description |
---|---|
integer | The number of related objects processed. |
- Access
- protected
- Uses
- \xPDOObject::_saveRelatedObject()
_setRaw(
string $key, mixed $val
)
:
boolean
Set a raw value on a field converted to the appropriate type.
Inherited from: \xPDOObject::_setRaw()\xPDOSimpleObject::_setRaw()\modPrincipal::_setRaw()\modUser::_setRaw()Name | Type | Description |
---|---|---|
$key | string | The key identifying the field to set. |
$val | mixed | The value to set. |
Type | Description |
---|---|
boolean | Returns true if the value was set, false otherwise. |
- Access
- protected
activatePassword(
string $key
)
:
boolean | integer
Activate a reset user password if the proper activation key is provided.
Inherited from: \modUser::activatePassword(){@internal This does not mark the user active, but rather moves the cachepwd to the password field if the activation key matches.}
Name | Type | Description |
---|---|---|
$key | string | The activation key provided to the user and stored in the registry for matching. |
Type | Description |
---|---|
boolean | integer | True if the activation was successful, false if unsuccessful, and -1 if there is no activation to perform. |
addFieldAlias(
string $field, string $alias
)
:
bool
Add an alias as a reference to an actual field of the object.
Inherited from: \xPDOObject::addFieldAlias()\xPDOSimpleObject::addFieldAlias()\modPrincipal::addFieldAlias()\modUser::addFieldAlias()Name | Type | Description |
---|---|---|
$field | string | The field name to create a reference to. |
$alias | string | The name of the reference. |
Type | Description |
---|---|
bool | True if the reference is added successfully. |
addMany(
mixed $obj, string $alias
=
''
)
:
boolean
Adds an object or collection of objects related to this class.
Inherited from: \xPDOObject::addMany()\xPDOSimpleObject::addMany()\modPrincipal::addMany()\modUser::addMany()This method adds an object or collection of objects in a one-to- many foreign key relationship with this object to the internal list of related objects. By adding these related objects, you can cascade {@link xPDOObject::save()}, {@link xPDOObject::remove()}, and other operations based on the type of relationships defined.
Name | Type | Description |
---|---|---|
$obj | mixed | &$obj A single object or collection of objects to be related to this instance via the intersection class. |
$alias | string | An optional alias, required only for instances where you have more than one relation defined to the same class. |
Type | Description |
---|---|
boolean | Indicates if the addMany was successful. |
addOne(
mixed $obj, string $alias
=
''
)
:
boolean
Adds an object related to this instance by a foreign key relationship.
Inherited from: \xPDOObject::addOne()\xPDOSimpleObject::addOne()\modPrincipal::addOne()\modUser::addOne()Name | Type | Description |
---|---|---|
$obj | mixed | &$obj A single object to be related to this instance. |
$alias | string | The relation alias of the related object (only required if more than one relation exists to the same foreign class). |
Type | Description |
---|---|
boolean | True if the related object was added to this object. |
addSessionContext(
string $context
)
:
void
Adds a new context to the user session context array.
Inherited from: \modUser::addSessionContext()Name | Type | Description |
---|---|---|
$context | string | The context to add to the user session. |
- Access
- public
addValidationRule(
string $field, string $name, string $type, string $rule, array $parameters
=
array()
)
:
void
Add a validation rule to an object field for this instance.
Inherited from: \xPDOObject::addValidationRule()\xPDOSimpleObject::addValidationRule()\modPrincipal::addValidationRule()\modUser::addValidationRule()Name | Type | Description |
---|---|---|
$field | string | The field key to apply the rule to. |
$name | string | A name to identify the rule. |
$type | string | The type of rule. |
$rule | string | The rule definition. |
$parameters | array | Any input parameters for the rule. |
changePassword(
string $newPassword, string $oldPassword
)
:
boolean
Name | Type | Description |
---|---|---|
$newPassword | string | Password to set. |
$oldPassword | string | Current password for validation. |
Type | Description |
---|---|
boolean | Indicates if password was successfully changed. |
- Access
- public
countMessages(
mixed $read
=
''
)
:
integer
Gets a count of {@link modUserMessage} objects ascribed to the user.
Inherited from: \modUser::countMessages()Name | Type | Description |
---|---|---|
$read | mixed |
Type | Description |
---|---|
integer | The number of messages. |
- Access
- public
encode(
string $source, string $type
=
'md5'
)
:
string
Encodes a string using the specified algorithm.
Inherited from: \xPDOObject::encode()\xPDOSimpleObject::encode()\modPrincipal::encode()\modUser::encode()NOTE: This implementation currently only implements md5. To implement additional algorithms, override this function in your xPDOObject derivative classes.
Name | Type | Description |
---|---|---|
$source | string | The string source to encode. |
$type | string | The type of encoding algorithm to apply, md5 by default. |
Type | Description |
---|---|
string | The encoded string. |
endSession(
)
:
void
Ends a user session completely, including all contexts.
Inherited from: \modUser::endSession()- Access
- public
fromArray(
array $fldarray, string $keyPrefix
=
'', boolean $setPrimaryKeys
=
false, boolean $rawValues
=
false, boolean $adhocValues
=
false
)
:
void
Sets object fields from an associative array of key => value pairs.
Inherited from: \xPDOObject::fromArray()\xPDOSimpleObject::fromArray()\modPrincipal::fromArray()\modUser::fromArray()Name | Type | Description |
---|---|---|
$fldarray | array | An associative array of key => values. |
$keyPrefix | string | Specify an optional prefix to strip from all array keys in fldarray. |
$setPrimaryKeys | boolean | Optional param to set generated primary keys. |
$rawValues | boolean | Optional way to set values without calling the {@link xPDOObject::set()} method. |
$adhocValues | boolean | Optional way to set adhoc values so that all the values of fldarray become object vars. |
fromJSON(
string $jsonSource, string $keyPrefix
=
'', boolean $setPrimaryKeys
=
false, boolean $rawValues
=
false, boolean $adhocValues
=
false
)
:
void
Sets the object fields from a JSON object string.
Inherited from: \xPDOObject::fromJSON()\xPDOSimpleObject::fromJSON()\modPrincipal::fromJSON()\modUser::fromJSON()Name | Type | Description |
---|---|---|
$jsonSource | string | A JSON object string. |
$keyPrefix | string | An optional prefix to strip from the keys. |
$setPrimaryKeys | boolean | Indicates if primary key fields should be set. |
$rawValues | boolean | Indicates if values should be set raw or via {@link xPDOObject::set()}. |
$adhocValues | boolean | Indicates if ad hoc fields should be added to the xPDOObject from the source object. |
generatePassword(
integer $length
=
10, array $options
=
array()
)
:
string
Name | Type | Description |
---|---|---|
$length | integer | The length of the password |
$options | array |
Type | Description |
---|---|
string | The newly generated password |
generateToken(
string $salt
)
:
string
Generate a specific authentication token for this user for accessing the MODX manager
Inherited from: \modUser::generateToken()Name | Type | Description |
---|---|---|
$salt | string | Ignored |
Type | Description |
---|---|
string |
get(
string | array $k, string | array $format
=
null, mixed $formatTemplate
=
null
)
:
mixed
Get a field value (or a set of values) by the field key(s) or name(s).
Inherited from: \xPDOObject::get()\xPDOSimpleObject::get()\modPrincipal::get()\modUser::get()Warning: do not use the $format parameter if retrieving multiple values of different types, as the format string will be applied to all types, most likely with unpredicatable results. Optionally, you can supply an associate array of format strings with the field key as the key for the format array.
Name | Type | Description |
---|---|---|
$k | string | array | A string (or an array of strings) representing the field key or name. |
$format | string | array | An optional variable (or an array of variables) to format the return value(s). |
$formatTemplate | mixed | An additional optional variable that can be used in formatting the return value(s). |
Type | Description |
---|---|
mixed | The value(s) of the field(s) requested. |
getAttributes(
array $targets
=
array(), string $context
=
'', boolean $reload
=
false
)
:
array
Get the attributes for this principal.
Inherited from: \modPrincipal::getAttributes()\modUser::getAttributes()Name | Type | Description |
---|---|---|
$targets | array | An array of target modAccess classes to load. |
$context | string | The context to check within. Defaults to active context. |
$reload | boolean | If true, the attributes will be reloaded and the session updated. |
Type | Description |
---|---|
array | An array of attributes on the principal |
getFKClass(
string $k
)
:
void
Get the name of a class related by foreign key to a specified field key.
Inherited from: \xPDOObject::getFKClass()\xPDOSimpleObject::getFKClass()\modPrincipal::getFKClass()\modUser::getFKClass()This is generally used to lookup classes involved in one-to-one relationships with the current object.
Name | Type | Description |
---|---|---|
$k | string | The field name or key to lookup a related class for. |
getFKDefinition(
string $alias
)
:
array
Get a foreign key definition for a specific classname.
Inherited from: \xPDOObject::getFKDefinition()\xPDOSimpleObject::getFKDefinition()\modPrincipal::getFKDefinition()\modUser::getFKDefinition()This is generally used to lookup classes in a one-to-many relationship with the current object.
Name | Type | Description |
---|---|---|
$alias | string | Alias of the related class to lookup a foreign key definition from. |
Type | Description |
---|---|
array | A foreign key definition. |
getField(
string $key, bool $validate
=
false
)
:
string | bool
Get a field name, looking up any by alias if not an actual field.
Inherited from: \xPDOObject::getField()\xPDOSimpleObject::getField()\modPrincipal::getField()\modUser::getField()Name | Type | Description |
---|---|---|
$key | string | The field name or alias to translate to the actual field name. |
$validate | bool | If true, the method will return false if the field or an alias of it is not found. Otherwise, the key is returned as passed. |
Type | Description |
---|---|
string | bool | The actual field name, the key as passed, or false if not a field or alias and validate is true. |
getFieldName(
string $k, string $alias
=
null
)
:
string
Gets a field name as represented in the database container.
Inherited from: \xPDOObject::getFieldName()\xPDOSimpleObject::getFieldName()\modPrincipal::getFieldName()\modUser::getFieldName()This gets the name of the field, fully-qualified by either the object table name or a specified alias, and properly quoted.
Name | Type | Description |
---|---|---|
$k | string | The simple name of the field. |
$alias | string | An optional alias for the table in a specific query. |
Type | Description |
---|---|
string | The name of the field, qualified with the table name or an optional table alias. |
getGraph(
boolean | string | array | integer $graph
=
true, \xPDOCriteria | array | string | integer $criteria
=
null, boolean | integer $cacheFlag
=
true
)
:
array | boolean
Load a graph of related objects to the current object.
Inherited from: \xPDOObject::getGraph()\xPDOSimpleObject::getGraph()\modPrincipal::getGraph()\modUser::getGraph()Name | Type | Description |
---|---|---|
$graph | boolean | string | array | integer | An option to tell how to deal with related objects. If integer, will traverse related objects up to a $graph level of depth and load them to the object. If an array, will traverse required related object and load them to the object. If true, will traverse the entire graph and append all related objects to the object (default behavior). |
$criteria | \xPDOCriteria | array | string | integer | A valid xPDO criteria representation. |
$cacheFlag | boolean | integer | Indicates if the objects should be cached and optionally, by specifying an integer value, for how many seconds. |
Type | Description |
---|---|
array | boolean | The graph that was loaded or false if nothing was loaded. |
getIterator(
string $alias, null | array | \xPDOCriteria $criteria
=
null, bool | int $cacheFlag
=
true
)
:
bool | \xPDOIterator
Get an xPDOIterator for a collection of objects related by aggregate or composite relations.
Inherited from: \xPDOObject::getIterator()\xPDOSimpleObject::getIterator()\modPrincipal::getIterator()\modUser::getIterator()Name | Type | Description |
---|---|---|
$alias | string | The alias of the relation. |
$criteria | null | array | \xPDOCriteria | A valid xPDO criteria expression. |
$cacheFlag | bool | int | Indicates if the objects should be cached and optionally, by specifying an integer values, for how many seconds. |
Type | Description |
---|---|
bool | \xPDOIterator | An iterator for the collection or false if no relation is found. |
getMany(
string $alias, object $criteria
=
null, boolean | integer $cacheFlag
=
true
)
:
array
Gets a collection of objects related by aggregate or composite relations.
Inherited from: \xPDOObject::getMany()\xPDOSimpleObject::getMany()\modPrincipal::getMany()\modUser::getMany()Name | Type | Description |
---|---|---|
$alias | string | Alias of the foreign class representing the related object. |
$criteria | object | xPDOCriteria object to get the related objects |
$cacheFlag | boolean | integer | Indicates if the objects should be cached and optionally, by specifying an integer value, for how many seconds. |
Type | Description |
---|---|
array | A collection of related objects or an empty array. |
getOne(
string $alias, object $criteria
=
null, boolean | integer $cacheFlag
=
true
)
:
\xPDOObject | null
Gets an object related to this instance by a foreign key relationship.
Inherited from: \xPDOObject::getOne()\xPDOSimpleObject::getOne()\modPrincipal::getOne()\modUser::getOne()Use this for 1:? (one:zero-or-one) or 1:1 relationships, which you can distinguish by setting the nullability of the field representing the foreign key.
For all 1:* relationships for this instance, see {@link getMany()}.
Name | Type | Description |
---|---|---|
$alias | string | Alias of the foreign class representing the related object. |
$criteria | object | xPDOCriteria object to get the related objects |
$cacheFlag | boolean | integer | Indicates if the object should be cached and optionally, by specifying an integer value, for how many seconds. |
Type | Description |
---|---|
\xPDOObject | null | The related object or null if no instance exists. |
getOption(
string $key, array | null $options
=
null, mixed $default
=
null
)
:
mixed
Get an option value for this instance.
Inherited from: \xPDOObject::getOption()\xPDOSimpleObject::getOption()\modPrincipal::getOption()\modUser::getOption()Name | Type | Description |
---|---|---|
$key | string | The option key to retrieve a value for. |
$options | array | null | An optional array to search for a value in first. |
$default | mixed | A default value to return if no value is found; null is the default. |
Type | Description |
---|---|
mixed | The value of the option or the provided default if it is not set. |
getPK(
)
:
mixed
Gets the name (or names) of the primary key field(s) for the object.
Inherited from: \xPDOObject::getPK()\xPDOSimpleObject::getPK()\modPrincipal::getPK()\modUser::getPK()Type | Description |
---|---|
mixed | The string (or an array of strings) representing the name(s) of the primary key field(s) for this instance. |
getPKType(
)
:
string
Gets the type of the primary key field for the object.
Inherited from: \xPDOObject::getPKType()\xPDOSimpleObject::getPKType()\modPrincipal::getPKType()\modUser::getPKType()Type | Description |
---|---|
string | The type of the primary key field for this instance. |
getPrimaryKey(
boolean $validateCompound
=
true
)
:
mixed
Gets the value (or values) of the primary key field(s) for the object.
Inherited from: \xPDOObject::getPrimaryKey()\xPDOSimpleObject::getPrimaryKey()\modPrincipal::getPrimaryKey()\modUser::getPrimaryKey()Name | Type | Description |
---|---|---|
$validateCompound | boolean | If any of the keys in a compound primary key are empty or null, and the default value is not allowed to be null, do not return an array, instead return null; the default is true |
Type | Description |
---|---|
mixed | The string (or an array) representing the value(s) of the primary key field(s) for this instance. |
getResourceGroups(
string $ctx
=
''
)
:
array
Gets all Resource Groups this user is assigned to. This may not work in the new model.
Inherited from: \modUser::getResourceGroups()Name | Type | Description |
---|---|---|
$ctx | string | The context in which to peruse for Resource Groups |
Type | Description |
---|---|
array | An array of Resource Group names. |
- Access
- public
getSelectColumns(
\xPDO $xpdo, string $className, string $tableAlias
=
'', string $columnPrefix
=
'', array $columns
=
array (), boolean $exclude
=
false
)
:
string
Get a set of column names from an xPDOObject for use in SQL queries.
Inherited from: \xPDOObject::getSelectColumns()\xPDOSimpleObject::getSelectColumns()\modPrincipal::getSelectColumns()\modUser::getSelectColumns()Name | Type | Description |
---|---|---|
$xpdo | \xPDO | &$xpdo A reference to an initialized xPDO instance. |
$className | string | The class name to get columns from. |
$tableAlias | string | An optional alias for the table in the query. |
$columnPrefix | string | An optional prefix to prepend to each column name. |
$columns | array | An optional array of field names to include or exclude (include is default behavior). |
$exclude | boolean | Determines if any specified columns should be included or excluded from the set of results. |
Type | Description |
---|---|
string | A comma-delimited list of the field names for use in a SELECT clause. |
- Static
getSessionContexts(
)
:
array
Returns an array of user session context keys.
Inherited from: \modUser::getSessionContexts()Type | Description |
---|---|
array | An array of session contexts. |
- Access
- public
getSettings(
)
:
array
Type | Description |
---|---|
array | A key -> value array of settings. |
- Access
- public
getUserGroupNames(
)
:
array
Gets all the User Group names of the groups this user belongs to.
Inherited from: \modUser::getUserGroupNames()Type | Description |
---|---|
array | An array of User Group names. |
- Access
- public
getUserGroups(
)
:
array
Gets all the User Group IDs of the groups this user belongs to.
Inherited from: \modUser::getUserGroups()Type | Description |
---|---|
array | An array of User Group IDs. |
- Access
- public
getUserToken(
string $ctx
=
''
)
:
string
Name | Type | Description |
---|---|---|
$ctx | string |
Type | Description |
---|---|
string |
getValidator(
)
:
string | boolean
Get the xPDOValidator class configured for this instance.
Inherited from: \xPDOObject::getValidator()\xPDOSimpleObject::getValidator()\modPrincipal::getValidator()\modUser::getValidator()Type | Description |
---|---|
string | boolean | The xPDOValidator instance or false if it could not be loaded. |
hasSessionContext(
mixed $context
)
:
boolean
Checks if the user has a specific session context.
Inherited from: \modUser::hasSessionContext()Name | Type | Description |
---|---|---|
$context | mixed | Either a name of a context or array of context names to check against. |
Type | Description |
---|---|
boolean | True if the user has the context(s) specified. |
- Access
- public
isAuthenticated(
string $sessionContext
=
'web'
)
:
boolean
Determines if this user is authenticated in a specific context.
Inherited from: \modUser::isAuthenticated()Separate session contexts can allow users to login/out of specific sub-sites individually (or in collections).
Name | Type | Description |
---|---|---|
$sessionContext | string | The context to determine if the user is authenticated in. |
Type | Description |
---|---|
boolean | true, if the user is authenticated in the specified context, false otherwise. |
- Access
- public
isDirty(
string $key
)
:
boolean
Indicates if an object field has been modified (or never saved).
Inherited from: \xPDOObject::isDirty()\xPDOSimpleObject::isDirty()\modPrincipal::isDirty()\modUser::isDirty()Name | Type | Description |
---|---|---|
$key | string | The field name to check. |
Type | Description |
---|---|
boolean | True if the field exists and either has been modified or the object is new. |
- Access
- public
isLazy(
string $key
=
''
)
:
boolean
Indicates if the object or specified field is lazy.
Inherited from: \xPDOObject::isLazy()\xPDOSimpleObject::isLazy()\modPrincipal::isLazy()\modUser::isLazy()Name | Type | Description |
---|---|---|
$key | string | Optional key to check for laziness. |
Type | Description |
---|---|
boolean | True if the field specified or if any field is lazy if no field is specified. |
isMember(
string | array $groups, boolean $matchAll
=
false
)
:
boolean
States whether a user is a member of a group or groups. You may specify either a string name of the group, or an array of names.
Inherited from: \modUser::isMember()Name | Type | Description |
---|---|---|
$groups | string | array | Either a string of a group name or an array of names. |
$matchAll | boolean | If true, requires the user to be a member of all the groups specified. If false, the user can be a member of only one to pass. Defaults to false. |
Type | Description |
---|---|
boolean | True if the user is a member of any of the groups specified. |
- Access
- public
isNew(
)
:
boolean
Indicates if the instance is new, and has not yet been persisted.
Inherited from: \xPDOObject::isNew()\xPDOSimpleObject::isNew()\modPrincipal::isNew()\modUser::isNew()Type | Description |
---|---|
boolean | True if the object has not been saved or was loaded from the database. |
isValidated(
string $key
=
''
)
:
boolean
Indicates if the object or specified field has been validated.
Inherited from: \xPDOObject::isValidated()\xPDOSimpleObject::isValidated()\modPrincipal::isValidated()\modUser::isValidated()Name | Type | Description |
---|---|---|
$key | string | Optional key to check for specific validation. |
Type | Description |
---|---|
boolean | True if the object or specified field has been fully validated successfully. |
joinGroup(
mixed $groupId, mixed $roleId
=
null
)
:
boolean
Name | Type | Description |
---|---|---|
$groupId | mixed | Either the name or ID of the User Group to join. |
$roleId | mixed | Optional. Either the name or ID of the Role to assign to for the group. |
Type | Description |
---|---|
boolean | True if successful. |
- Access
- public
leaveGroup(
mixed $groupId
)
:
boolean
Name | Type | Description |
---|---|---|
$groupId | mixed | Either the name or ID of the User Group to join. |
Type | Description |
---|---|
boolean | True if successful. |
- Access
- public
load(
\xPDO $xpdo, string $className, mixed $criteria, boolean | integer $cacheFlag
=
true
)
:
object | null
Load an instance of an xPDOObject or derivative class.
Inherited from: \xPDOObject::load()\xPDOSimpleObject::load()\modPrincipal::load()\modUser::load()Name | Type | Description |
---|---|---|
$xpdo | \xPDO | &$xpdo A valid xPDO instance. |
$className | string | Name of the class. |
$criteria | mixed | A valid primary key, criteria array, or xPDOCriteria instance. |
$cacheFlag | boolean | integer | Indicates if the objects should be cached and optionally, by specifying an integer value, for how many seconds. |
Type | Description |
---|---|
object | null | An instance of the requested class, or null if it could not be instantiated. |
- Static
loadAttributes(
string $target, string $context
=
'', boolean $reload
=
false
)
:
void
Loads the principal attributes that define a modUser security profile.
Inherited from: \modUser::loadAttributes(){@internal Implement this function in derivatives to control how your user class uses the MODX ABAC (Attribute-Based Access Control) security model}
Name | Type | Description |
---|---|---|
$target | string | The target modAccess classes to load attributes from. |
$context | string | Context to check within, defaults to current context. |
$reload | boolean | If true, the attributes will be reloaded and the session updated. |
loadCollection(
\xPDO $xpdo, string $className, mixed $criteria
=
null, boolean | integer $cacheFlag
=
true
)
:
array
Load a collection of xPDOObject instances.
Inherited from: \xPDOObject::loadCollection()\xPDOSimpleObject::loadCollection()\modPrincipal::loadCollection()\modUser::loadCollection()Name | Type | Description |
---|---|---|
$xpdo | \xPDO | &$xpdo A valid xPDO instance. |
$className | string | Name of the class. |
$criteria | mixed | A valid primary key, criteria array, or xPDOCriteria instance. |
$cacheFlag | boolean | integer | Indicates if the objects should be cached and optionally, by specifying an integer value, for how many seconds. |
Type | Description |
---|---|
array | An array of xPDOObject instances or an empty array if no instances are loaded. |
- Static
loadCollectionGraph(
\xPDO $xpdo, string $className, string | array $graph, mixed $criteria, boolean | integer $cacheFlag
)
:
array
Load a collection of xPDOObject instances and a graph of related objects.
Inherited from: \xPDOObject::loadCollectionGraph()\xPDOSimpleObject::loadCollectionGraph()\modPrincipal::loadCollectionGraph()\modUser::loadCollectionGraph()Name | Type | Description |
---|---|---|
$xpdo | \xPDO | &$xpdo A valid xPDO instance. |
$className | string | Name of the class. |
$graph | string | array | A related object graph in array or JSON format, e.g. array('relationAlias'=>array('subRelationAlias'=>array())) or {"relationAlias":{"subRelationAlias":{}}}. Note that the empty arrays are necessary in order for the relation to be recognized. |
$criteria | mixed | A valid primary key, criteria array, or xPDOCriteria instance. |
$cacheFlag | boolean | integer | Indicates if the objects should be cached and optionally, by specifying an integer value, for how many seconds. |
Type | Description |
---|---|
array | An array of xPDOObject instances or an empty array if no instances are loaded. |
- Static
passwordMatches(
string $password, array $options
=
array()
)
:
boolean
Determines if the provided password matches the hashed password stored for the user.
Inherited from: \modUser::passwordMatches()Name | Type | Description |
---|---|---|
$password | string | The password to determine if it matches. |
$options | array | Optional settings for the hashing process. |
Type | Description |
---|---|
boolean | True if the provided password matches the stored password for the user. |
remove(
array $ancestors
=
array()
)
:
boolean
Overrides xPDOObject::remove to fire modX-specific events
Inherited from: \modUser::remove()Deletes the persistent object isntance stored in the database when called, including any dependent objects defined by composite foreign key relationships.
Name | Type | Description |
---|---|---|
$ancestors | array | Keeps track of classes which have already been removed to prevent loop with circular references. |
Type | Description |
---|---|
boolean | Returns true on success, false on failure. |
removeLocks(
array $options
=
array()
)
:
boolean
Name | Type | Description |
---|---|---|
$options | array | An array of options for controlling removal of specific locks or lock types. |
Type | Description |
---|---|
boolean | True if the process was successful, or false if an error was encountered. |
removeSessionContext(
string | array $context
)
:
void
Name | Type | Description |
---|---|---|
$context | string | array | The context key or an array of context keys. |
- Access
- public
removeSessionContextVars(
string $context
)
:
void
Removes the session vars associated with a specific context.
Inherited from: \modUser::removeSessionContextVars()Name | Type | Description |
---|---|---|
$context | string | The context key. |
- Access
- public
removeSessionCookie(
string $context
)
:
void
TODO Implement this.
Name | Type | Description |
---|---|---|
$context | string | The context to remove. |
- Access
- public
removeValidationRules(
string $field
=
null, array $rules
=
array()
)
:
void
Remove one or more validation rules from this instance.
Inherited from: \xPDOObject::removeValidationRules()\xPDOSimpleObject::removeValidationRules()\modPrincipal::removeValidationRules()\modUser::removeValidationRules()Name | Type | Description |
---|---|---|
$field | string | An optional field name to remove rules from. If not specified or null, all rules from all columns will be removed. |
$rules | array | An optional array of rule names to remove if a single field is specified. If $field is null, this parameter is ignored. |
save(
boolean | integer $cacheFlag
=
false
)
:
boolean
Inserts or updates the database record representing this object and any new or changed related object records. Both aggregate and composite related objects will be saved as appropriate, before or following the save operation on the controlling instance.
Name | Type | Description |
---|---|---|
$cacheFlag | boolean | integer | Indicates if the saved object(s) should be cached and optionally, by specifying an integer value, for how many seconds before expiring. Overrides the cacheFlag for the object(s). |
Type | Description |
---|---|
boolean | Returns true on success, false on failure. |
sendEmail(
string $message, array $options
=
array()
)
:
boolean
Name | Type | Description |
---|---|---|
$message | string | The body of the email |
$options | array | An array of options |
Type | Description |
---|---|
boolean | True if successful |
set(
string $k, mixed $v
=
null, string | \callable $vType
=
''
)
:
boolean
Name | Type | Description |
---|---|---|
$k | string | The field key or name. |
$v | mixed | The value to set the field to. |
$vType | string | \callable | A string indicating the format of the provided value parameter, or a callable function that should be used to set the field value, overriding the default behavior. |
Type | Description |
---|---|
boolean | Determines whether the value was set successfully and was determined to be dirty (i.e. different from the previous value). |
setDirty(
string $key
=
''
)
:
void
Add the field to a collection of field keys that have been modified.
Inherited from: \xPDOObject::setDirty()\xPDOSimpleObject::setDirty()\modPrincipal::setDirty()\modUser::setDirty()This function also clears any validation flag associated with the field.
Name | Type | Description |
---|---|---|
$key | string | The key of the field to set dirty. |
setOption(
string $key, mixed $value
)
:
void
Set an option value for this instance.
Inherited from: \xPDOObject::setOption()\xPDOSimpleObject::setOption()\modPrincipal::setOption()\modUser::setOption()Name | Type | Description |
---|---|---|
$key | string | The option key to set a value for. |
$value | mixed | A value to assign to the option. |
toArray(
string $keyPrefix
=
'', boolean $rawValues
=
false, boolean $excludeLazy
=
false, boolean | integer | string | array $includeRelated
=
false
)
:
array
Copies the object fields and corresponding values to an associative array.
Inherited from: \xPDOObject::toArray()\xPDOSimpleObject::toArray()\modPrincipal::toArray()\modUser::toArray()Name | Type | Description |
---|---|---|
$keyPrefix | string | An optional prefix to prepend to the field values. |
$rawValues | boolean | An optional flag indicating if you want the raw values instead of those returned by the {@link xPDOObject::get()} function. |
$excludeLazy | boolean | An option flag indicating if you want to exclude lazy fields from the resulting array; the default behavior is to include them which means the object will query the database for the lazy fields before providing the value. |
$includeRelated | boolean | integer | string | array | Describes if and how to include loaded related object fields. As an integer all loaded related objects in the graph up to that level of depth will be included. As a string, only loaded related objects matching the JSON graph representation will be included. As an array, only loaded related objects matching the graph array will be included. As boolean true, all currently loaded related objects will be included. |
Type | Description |
---|---|
array | An array representation of the object fields/values. |
toJSON(
string $keyPrefix
=
'', boolean $rawValues
=
false
)
:
string
Returns a JSON representation of the object.
Inherited from: \xPDOObject::toJSON()\xPDOSimpleObject::toJSON()\modPrincipal::toJSON()\modUser::toJSON()Name | Type | Description |
---|---|---|
$keyPrefix | string | An optional prefix to prepend to the field keys. |
$rawValues | boolean | An optional flag indicating if the field values should be returned raw or via {@link xPDOObject::get()}. |
Type | Description |
---|---|
string | A JSON string representing the object. |
validate(
array $options
=
array()
)
:
boolean
Validate the field values using an xPDOValidator.
Inherited from: \xPDOObject::validate()\xPDOSimpleObject::validate()\modPrincipal::validate()\modUser::validate()Name | Type | Description |
---|---|---|
$options | array | An array of options to pass to the validator. |
Type | Description |
---|---|
boolean | True if validation was successful. |