core/model/modx/mysql/modchunk.class.php

Show: inherited
Table of Contents

Package
modx  
Subpackage
mysql  

\modChunk_mysql

Package: modx\mysql

Represents a chunk of static HTML content.

These elements are defined by some type of source content that when processed will provide output or some type of logical result based on mutable properties.

This class creates an instance of a modElement object. This should not be called directly, but rather extended for derivative modElement classes.

Parent(s)
\modChunk < \modElement < \modAccessibleSimpleObject < \modAccessibleObject < \xPDOObject

Properties

Propertypublicarray  $_aggregates= 'array ()'
Default valuearray ()Details
Type
array
Access
public  
Inherited_from
\xPDOObject::$$_aggregates  
Inherited_from
\modAccessibleObject::$$_aggregates  
Inherited_from
\modAccessibleSimpleObject::$$_aggregates  
Inherited_from
\modElement::$$_aggregates  
Inherited_from
\modChunk::$$_aggregates  
Propertypublicstring  $_alias= 'null'
Default valuenullDetails
Type
string
Inherited_from
\xPDOObject::$$_alias  
Inherited_from
\modAccessibleObject::$$_alias  
Inherited_from
\modAccessibleSimpleObject::$$_alias  
Inherited_from
\modElement::$$_alias  
Inherited_from
\modChunk::$$_alias  
Propertypublicboolean  $_cacheFlag= 'true'
Default valuetrueDetails
Type
boolean
Inherited_from
\xPDOObject::$$_cacheFlag  
Inherited_from
\modAccessibleObject::$$_cacheFlag  
Inherited_from
\modAccessibleSimpleObject::$$_cacheFlag  
Inherited_from
\modElement::$$_cacheFlag  
Inherited_from
\modChunk::$$_cacheFlag  
Propertypublicboolean  $_cacheable= 'true'
inherited

If the element is cacheable or not.Inherited from: \modElement::$$_cacheable\modChunk::$$_cacheable
Default valuetrueDetails
Type
boolean
Inherited_from
\modElement::$$_cacheable  
Inherited_from
\modChunk::$$_cacheable  
Propertypublicstring  $_class= 'null'
Default valuenullDetails
Type
string
Inherited_from
\xPDOObject::$$_class  
Inherited_from
\modAccessibleObject::$$_class  
Inherited_from
\modAccessibleSimpleObject::$$_class  
Inherited_from
\modElement::$$_class  
Inherited_from
\modChunk::$$_class  
Propertypublicarray  $_composites= 'array ()'
Default valuearray ()Details
Type
array
Access
public  
Inherited_from
\xPDOObject::$$_composites  
Inherited_from
\modAccessibleObject::$$_composites  
Inherited_from
\modAccessibleSimpleObject::$$_composites  
Inherited_from
\modElement::$$_composites  
Inherited_from
\modChunk::$$_composites  
Propertypublicstring  $_content= ''''
inherited

The source content of the element.

Inherited from: \modElement::$$_content\modChunk::$$_content
Default value''Details
Type
string
Inherited_from
\modElement::$$_content  
Inherited_from
\modChunk::$$_content  
Propertypublicarray  $_dirty= 'array ()'
Default valuearray ()Details
Type
array
Access
public  
Inherited_from
\xPDOObject::$$_dirty  
Inherited_from
\modAccessibleObject::$$_dirty  
Inherited_from
\modAccessibleSimpleObject::$$_dirty  
Inherited_from
\modElement::$$_dirty  
Inherited_from
\modChunk::$$_dirty  
Propertypublicarray  $_fieldAliases= 'array()'
Default valuearray()Details
Type
array
Inherited_from
\xPDOObject::$$_fieldAliases  
Inherited_from
\modAccessibleObject::$$_fieldAliases  
Inherited_from
\modAccessibleSimpleObject::$$_fieldAliases  
Inherited_from
\modElement::$$_fieldAliases  
Inherited_from
\modChunk::$$_fieldAliases  
Propertypublicarray  $_fieldMeta= 'array ()'
Default valuearray ()Details
Type
array
Access
public  
Inherited_from
\xPDOObject::$$_fieldMeta  
Inherited_from
\modAccessibleObject::$$_fieldMeta  
Inherited_from
\modAccessibleSimpleObject::$$_fieldMeta  
Inherited_from
\modElement::$$_fieldMeta  
Inherited_from
\modChunk::$$_fieldMeta  
Propertypublicarray  $_fields= 'array ()'
inherited

An array of key-value pairs representing the fields of the instance.

Inherited from: \xPDOObject::$$_fields\modAccessibleObject::$$_fields\modAccessibleSimpleObject::$$_fields\modElement::$$_fields\modChunk::$$_fields
Default valuearray ()Details
Type
array
Access
public  
Inherited_from
\xPDOObject::$$_fields  
Inherited_from
\modAccessibleObject::$$_fields  
Inherited_from
\modAccessibleSimpleObject::$$_fields  
Inherited_from
\modElement::$$_fields  
Inherited_from
\modChunk::$$_fields  
Propertypublicarray  $_filters= 'array('input' => null, 'output' => null)'
inherited

Optional filters that can be used during processing.Inherited from: \modElement::$$_filters\modChunk::$$_filters
Default valuearray('input' => null, 'output' => null)Details
Type
array
Inherited_from
\modElement::$$_filters  
Inherited_from
\modChunk::$$_filters  
Propertyprotectedarray  $_invalidCharacters= 'array('!','@','#','$','%','^','&','*', '(',')','+','=','[',']','{','}','\'','"',';',':','\\','/','<','>','?' ,' ',',','`','~')'
inherited

A list of invalid characters in the name of an Element.Inherited from: \modElement::$$_invalidCharacters\modChunk::$$_invalidCharacters
Default valuearray('!','@','#','$','%','^','&','*', '(',')','+','=','[',']','{','}','\'','"',';',':','\\','/','<','>','?' ,' ',',','`','~')Details
Type
array
Inherited_from
\modElement::$$_invalidCharacters  
Inherited_from
\modChunk::$$_invalidCharacters  
Propertypublicarray  $_lazy= 'array ()'
inherited

An array of field names that have not been loaded from the source.

Inherited from: \xPDOObject::$$_lazy\modAccessibleObject::$$_lazy\modAccessibleSimpleObject::$$_lazy\modElement::$$_lazy\modChunk::$$_lazy
Default valuearray ()Details
Type
array
Access
public  
Inherited_from
\xPDOObject::$$_lazy  
Inherited_from
\modAccessibleObject::$$_lazy  
Inherited_from
\modAccessibleSimpleObject::$$_lazy  
Inherited_from
\modElement::$$_lazy  
Inherited_from
\modChunk::$$_lazy  
Propertypublicboolean  $_new= 'true'
inherited

Indicates if the instance is transient (and thus new).

Inherited from: \xPDOObject::$$_new\modAccessibleObject::$$_new\modAccessibleSimpleObject::$$_new\modElement::$$_new\modChunk::$$_new
Default valuetrueDetails
Type
boolean
Access
public  
Inherited_from
\xPDOObject::$$_new  
Inherited_from
\modAccessibleObject::$$_new  
Inherited_from
\modAccessibleSimpleObject::$$_new  
Inherited_from
\modElement::$$_new  
Inherited_from
\modChunk::$$_new  
Propertypublicarray  $_options= 'array()'
inherited

A collection of various options that can be used on the instance.

Inherited from: \xPDOObject::$$_options\modAccessibleObject::$$_options\modAccessibleSimpleObject::$$_options\modElement::$$_options\modChunk::$$_options
Default valuearray()Details
Type
array
Inherited_from
\xPDOObject::$$_options  
Inherited_from
\modAccessibleObject::$$_options  
Inherited_from
\modAccessibleSimpleObject::$$_options  
Inherited_from
\modElement::$$_options  
Inherited_from
\modChunk::$$_options  
Propertypublicstring  $_output= ''''
inherited

The output of the element.

Inherited from: \modElement::$$_output\modChunk::$$_output
Default value''Details
Type
string
Inherited_from
\modElement::$$_output  
Inherited_from
\modChunk::$$_output  
Propertypublicstring  $_package= 'null'
Default valuenullDetails
Type
string
Inherited_from
\xPDOObject::$$_package  
Inherited_from
\modAccessibleObject::$$_package  
Inherited_from
\modAccessibleSimpleObject::$$_package  
Inherited_from
\modElement::$$_package  
Inherited_from
\modChunk::$$_package  
Propertypublicstring|array  $_pk= 'null'
inherited

The primary key field (or an array of primary key fields) for this object.

Inherited from: \xPDOObject::$$_pk\modAccessibleObject::$$_pk\modAccessibleSimpleObject::$$_pk\modElement::$$_pk\modChunk::$$_pk
Default valuenullDetails
Type
string | array
Access
public  
Inherited_from
\xPDOObject::$$_pk  
Inherited_from
\modAccessibleObject::$$_pk  
Inherited_from
\modAccessibleSimpleObject::$$_pk  
Inherited_from
\modElement::$$_pk  
Inherited_from
\modChunk::$$_pk  
Propertypublicstring|array  $_pktype= 'null'

NOTE: Will be an array if multiple primary keys are specified for the object.

Default valuenullDetails
Type
string | array
Access
public  
Inherited_from
\xPDOObject::$$_pktype  
Inherited_from
\modAccessibleObject::$$_pktype  
Inherited_from
\modAccessibleSimpleObject::$$_pktype  
Inherited_from
\modElement::$$_pktype  
Inherited_from
\modChunk::$$_pktype  
Propertyprotectedarray  $_policies= 'array()'
Default valuearray()Details
Type
array
Inherited_from
\modAccessibleObject::$$_policies  
Inherited_from
\modAccessibleSimpleObject::$$_policies  
Inherited_from
\modElement::$$_policies  
Inherited_from
\modChunk::$$_policies  
Propertypublicboolean  $_processed= 'false'
inherited

Indicates if the element was processed already.Inherited from: \modElement::$$_processed\modChunk::$$_processed
Default valuefalseDetails
Type
boolean
Inherited_from
\modElement::$$_processed  
Inherited_from
\modChunk::$$_processed  
Propertypublicarray  $_properties= 'null'
inherited

The property value array for the element.

Inherited from: \modElement::$$_properties\modChunk::$$_properties
Default valuenullDetails
Type
array
Inherited_from
\modElement::$$_properties  
Inherited_from
\modChunk::$$_properties  
Propertypublicstring  $_propertyString= ''''
inherited

The string representation of the element properties.

Inherited from: \modElement::$$_propertyString\modChunk::$$_propertyString
Default value''Details
Type
string
Inherited_from
\modElement::$$_propertyString  
Inherited_from
\modChunk::$$_propertyString  
Propertypublicarray  $_relatedObjects= 'array ()'
Default valuearray ()Details
Type
array
Access
public  
Inherited_from
\xPDOObject::$$_relatedObjects  
Inherited_from
\modAccessibleObject::$$_relatedObjects  
Inherited_from
\modAccessibleSimpleObject::$$_relatedObjects  
Inherited_from
\modElement::$$_relatedObjects  
Inherited_from
\modChunk::$$_relatedObjects  
Propertypublicboolean  $_result= 'true'
inherited

The boolean result of the element.

Inherited from: \modElement::$$_result\modChunk::$$_result

This is typically only applicable to elements that use PHP source content.

Default valuetrueDetails
Type
boolean
Inherited_from
\modElement::$$_result  
Inherited_from
\modChunk::$$_result  
Propertypublicstring  $_source= 'null'
inherited

The source of the element.

Inherited from: \modElement::$$_source\modChunk::$$_source
Default valuenullDetails
Type
string
Inherited_from
\modElement::$$_source  
Inherited_from
\modChunk::$$_source  
Propertyprotectedstring  $_sourceFile= '""'
inherited

Source file name when modElement->isStatic() === true.Inherited from: \modElement::$$_sourceFile\modChunk::$$_sourceFile
Default value""Details
Type
string
Inherited_from
\modElement::$$_sourceFile  
Inherited_from
\modChunk::$$_sourceFile  
Propertyprotectedstring  $_sourcePath= '""'
inherited

Path to source file location when modElement->isStatic() === true.Inherited from: \modElement::$$_sourcePath\modChunk::$$_sourcePath
Default value""Details
Type
string
Inherited_from
\modElement::$$_sourcePath  
Inherited_from
\modChunk::$$_sourcePath  
Propertypublicstring  $_table= 'null'
Default valuenullDetails
Type
string
Access
public  
Inherited_from
\xPDOObject::$$_table  
Inherited_from
\modAccessibleObject::$$_table  
Inherited_from
\modAccessibleSimpleObject::$$_table  
Inherited_from
\modElement::$$_table  
Inherited_from
\modChunk::$$_table  
Propertypublicstring  $_tableMeta= 'null'
Default valuenullDetails
Type
string
Access
public  
Inherited_from
\xPDOObject::$$_tableMeta  
Inherited_from
\modAccessibleObject::$$_tableMeta  
Inherited_from
\modAccessibleSimpleObject::$$_tableMeta  
Inherited_from
\modElement::$$_tableMeta  
Inherited_from
\modChunk::$$_tableMeta  
Propertypublicstring  $_tag= 'null'
inherited

The tag signature of the element instance.

Inherited from: \modElement::$$_tag\modChunk::$$_tag
Default valuenullDetails
Type
string
Inherited_from
\modElement::$$_tag  
Inherited_from
\modChunk::$$_tag  
Propertypublicstring  $_token= ''''
inherited

The character token which helps identify the element class in tag string.

Inherited from: \modElement::$$_token\modChunk::$$_token
Default value''Details
Type
string
Inherited_from
\modElement::$$_token  
Inherited_from
\modChunk::$$_token  
Propertypublicarray  $_validated= 'array ()'
Default valuearray ()Details
Type
array
Access
public  
Inherited_from
\xPDOObject::$$_validated  
Inherited_from
\modAccessibleObject::$$_validated  
Inherited_from
\modAccessibleSimpleObject::$$_validated  
Inherited_from
\modElement::$$_validated  
Inherited_from
\modChunk::$$_validated  
Propertypublicboolean  $_validationLoaded= 'false'
Default valuefalseDetails
Type
boolean
Access
public  
Inherited_from
\xPDOObject::$$_validationLoaded  
Inherited_from
\modAccessibleObject::$$_validationLoaded  
Inherited_from
\modAccessibleSimpleObject::$$_validationLoaded  
Inherited_from
\modElement::$$_validationLoaded  
Inherited_from
\modChunk::$$_validationLoaded  
Propertypublicarray  $_validationRules= 'array()'
Default valuearray()Details
Type
array
Access
public  
Inherited_from
\xPDOObject::$$_validationRules  
Inherited_from
\modAccessibleObject::$$_validationRules  
Inherited_from
\modAccessibleSimpleObject::$$_validationRules  
Inherited_from
\modElement::$$_validationRules  
Inherited_from
\modChunk::$$_validationRules  
Propertypublic\xPDOValidator  $_validator= 'null'
Default valuenullDetails
Type
\xPDOValidator
Access
public  
Inherited_from
\xPDOObject::$$_validator  
Inherited_from
\modAccessibleObject::$$_validator  
Inherited_from
\modAccessibleSimpleObject::$$_validator  
Inherited_from
\modElement::$$_validator  
Inherited_from
\modChunk::$$_validator  
Propertypublicstring  $container= 'null'
Default valuenullDetails
Type
string
Access
public  
Inherited_from
\xPDOObject::$$container  
Inherited_from
\modAccessibleObject::$$container  
Inherited_from
\modAccessibleSimpleObject::$$container  
Inherited_from
\modElement::$$container  
Inherited_from
\modChunk::$$container  
Propertypublicarray  $fieldNames= 'null'
inherited

Names of the fields in the data table, fully-qualified with a table name.

Inherited from: \xPDOObject::$$fieldNames\modAccessibleObject::$$fieldNames\modAccessibleSimpleObject::$$fieldNames\modElement::$$fieldNames\modChunk::$$fieldNames

NOTE: For use in table joins to qualify fields with the same name.

Default valuenullDetails
Type
array
Access
public  
Inherited_from
\xPDOObject::$$fieldNames  
Inherited_from
\modAccessibleObject::$$fieldNames  
Inherited_from
\modAccessibleSimpleObject::$$fieldNames  
Inherited_from
\modElement::$$fieldNames  
Inherited_from
\modChunk::$$fieldNames  
Propertypublic\xPDO  $xpdo= 'null'
Default valuenullDetails
Type
\xPDO
Access
public  
Inherited_from
\xPDOObject::$$xpdo  
Inherited_from
\modAccessibleObject::$$xpdo  
Inherited_from
\modAccessibleSimpleObject::$$xpdo  
Inherited_from
\modElement::$$xpdo  
Inherited_from
\modChunk::$$xpdo  

Methods

methodpublic__construct( \xPDO $xpdo ) : \xPDOObject
inherited

Overrides modElement::__construct to set the tag token for this Element

Inherited from: \modChunk::__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
}
Parameters
Name Type Description
$xpdo \xPDO

A reference to the xPDO|modX instance

Returns
Type Description
\xPDOObject
methodprotected_getAliases( string $class, int $limit = 0 ) : array
Parameters
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.

Returns
Type Description
array An array of aliases or an empty array if none are found.
Details
Access
protected  
methodprotected_getDataType( string $key ) : string
Parameters
Name Type Description
$key string

The field name to get the data type for.

Returns
Type Description
string The DB data type of the field.
Details
Access
protected  
methodprotected_getPHPType( string $key ) : string
Parameters
Name Type Description
$key string

The field name to get the data type for.

Returns
Type Description
string The PHP data type of the field.
Details
Access
protected  
methodprotected_getRelatedObjectsByFK( string $alias, mixed $criteria = null, boolean | integer $cacheFlag = true ) : array
Parameters
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.

Returns
Type Description
array A collection of objects matching the criteria.
Details
Access
protected  
methodprotected_initFields( ) : void

Once this is called, you can lookup the qualified name by the field name itself in {@link xPDOObject::$fieldNames}.

Details
Access
protected  
methodpublic_loadCollectionInstance( \xPDO $xpdo, array $objCollection, string $className, mixed $criteria,  $row,  $fromCache, boolean | integer $cacheFlag = true ) : void

Parameters
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.

methodprotected_loadFieldData( string | array $fields ) : void
Parameters
Name Type Description
$fields string | array

A field name or array of field names to load from the data source.

Details
Access
protected  
methodpublic_loadInstance( \xPDO | \modX $xpdo, string $className, mixed $criteria, int $row ) : \modAccessibleObject | null
staticinherited

Custom instance from row loader that respects policy checking

Inherited from: \modAccessibleObject::_loadInstance()\modAccessibleSimpleObject::_loadInstance()\modElement::_loadInstance()\modChunk::_loadInstance()
Parameters
Name Type Description
$xpdo \xPDO | \modX

A reference to the xPDO/modX object.

$className string

The name of the class by which to grab the instance from

$criteria mixed

A criteria to use when grabbing this instance

$row int

The row to select

Returns
Type Description
\modAccessibleObject | null An instance of the object
methodpublic_loadRows( \xPDO $xpdo, string $className, \xPDOCriteria $criteria ) : \PDOStatement
Parameters
Name Type Description
$xpdo \xPDO

&$xpdo A valid xPDO instance.

$className string

Name of the class.

$criteria \xPDOCriteria

A valid xPDOCriteria instance.

Returns
Type Description
\PDOStatement A reference to a PDOStatement representing the result set.
Details
Static
 
methodpublic_loadValidation( boolean $reload = false ) : void
Parameters
Name Type Description
$reload boolean

Indicates if the schema validation rules should be reloaded.

Details
Access
public  
methodprotected_saveRelatedObject( \xPDOObject $obj, array $fkMeta ) : boolean

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.

Parameters
Name Type Description
$obj \xPDOObject

&$obj A reference to the related object.

$fkMeta array

The meta data representing the relation.

Returns
Type Description
boolean True if a related object was dirty and saved successfully.
Details
Access
protected  
methodprotected_saveRelatedObjects( ) : integer
Returns
Type Description
integer The number of related objects processed.
Details
Access
protected  
Uses
\xPDOObject::_saveRelatedObject()  
methodprotected_setRaw( string $key, mixed $val ) : boolean
inherited

Set a raw value on a field converted to the appropriate type.

Inherited from: \xPDOObject::_setRaw()\modAccessibleObject::_setRaw()\modAccessibleSimpleObject::_setRaw()\modElement::_setRaw()\modChunk::_setRaw()
Parameters
Name Type Description
$key string

The key identifying the field to set.

$val mixed

The value to set.

Returns
Type Description
boolean Returns true if the value was set, false otherwise.
Details
Access
protected  
methodpublicaddFieldAlias( string $field, string $alias ) : bool
Parameters
Name Type Description
$field string

The field name to create a reference to.

$alias string

The name of the reference.

Returns
Type Description
bool True if the reference is added successfully.
methodpublicaddMany( mixed $obj, string $alias = '' ) : boolean
inherited

Adds an object or collection of objects related to this class.

Inherited from: \xPDOObject::addMany()\modAccessibleObject::addMany()\modAccessibleSimpleObject::addMany()\modElement::addMany()\modChunk::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.

Parameters
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.

Returns
Type Description
boolean Indicates if the addMany was successful.
Details
See
\xPDOObject::addOne()  
See
\xPDOObject::getOne()  
See
\xPDOObject::getMany()  
methodpublicaddOne( mixed $obj, string $alias = '' ) : boolean
inherited

Adds an object related to this instance by a foreign key relationship.

Inherited from: \xPDOObject::addOne()\modAccessibleObject::addOne()\modAccessibleSimpleObject::addOne()\modElement::addOne()\modChunk::addOne()
Parameters
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).

Returns
Type Description
boolean True if the related object was added to this object.
Details
See
\xPDOObject::getOne()  
See
\xPDOObject::getMany()  
See
\xPDOObject::addMany()  
methodpublicaddPropertySet( string | \modPropertySet $propertySet ) : boolean
inherited

Add a property set to this element, making it available for use.

Inherited from: \modElement::addPropertySet()\modChunk::addPropertySet()
Parameters
Name Type Description
$propertySet string | \modPropertySet

A modPropertySet object or the name of a modPropertySet object to create a relationship with.

Returns
Type Description
boolean True if a relationship was created or already exists.
Details
Access
public  
methodpublicaddValidationRule( string $field, string $name, string $type, string $rule, array $parameters = array() ) : void
Parameters
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.

methodpubliccache( ) : void
inherited

Cache the current output of this element instance by tag signature.

Inherited from: \modElement::cache()\modChunk::cache()
methodpubliccheckPolicy( array $criteria, string | array $targets = null ) : boolean
inherited

Determine if the current user attributes satisfy the object policy.

Inherited from: \modAccessibleObject::checkPolicy()\modAccessibleSimpleObject::checkPolicy()\modElement::checkPolicy()\modChunk::checkPolicy()
Parameters
Name Type Description
$criteria array

An associative array providing a key and value to search for within the matched policy attributes between policy and principal.

$targets string | array

A target modAccess class name or an array of class names to limit the check. In most cases, this does not need to be set; derivatives should typically determine what targets to include in the findPolicy() implementation.

Returns
Type Description
boolean Returns true if the policy is satisfied or no policy exists.
methodpublicencode( string $source, string $type = 'md5' ) : string

NOTE: This implementation currently only implements md5. To implement additional algorithms, override this function in your xPDOObject derivative classes.

Parameters
Name Type Description
$source string

The string source to encode.

$type string

The type of encoding algorithm to apply, md5 by default.

Returns
Type Description
string The encoded string.
methodpublicfilterInput( ) : void
inherited

Apply an input filter to an element.

Inherited from: \modElement::filterInput()\modChunk::filterInput()

This is called by default in {@link modElement::process()} after the element properties have been parsed.

methodpublicfilterOutput( ) : void
inherited

Apply an output filter to an element.

Inherited from: \modElement::filterOutput()\modChunk::filterOutput()

Call this method in your {modElement::process()} implementation when it is appropriate, typically once all processing has been completed, but before any caching takes place.

methodpublicfindPolicy( string $context = '' ) : array
inherited

Loads the access control policies applicable to this element.

Inherited from: \modElement::findPolicy()\modChunk::findPolicy()

Parameters
Name Type Description
$context string

A key identifying a specific context to use when searching for the applicable policies. If not provided, the current context is used.

Returns
Type Description
array An array of access policies for this object; an empty array is returned if no policies are assigned to the object.
methodpublicfromArray( array $fldarray, string $keyPrefix = '', boolean $setPrimaryKeys = false, boolean $rawValues = false, boolean $adhocValues = false ) : void
inherited

Sets object fields from an associative array of key => value pairs.

Inherited from: \xPDOObject::fromArray()\modAccessibleObject::fromArray()\modAccessibleSimpleObject::fromArray()\modElement::fromArray()\modChunk::fromArray()
Parameters
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.

methodpublicfromJSON( string $jsonSource, string $keyPrefix = '', boolean $setPrimaryKeys = false, boolean $rawValues = false, boolean $adhocValues = false ) : void
Parameters
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.

methodpublicget( string | array $k, string | array $format = null, mixed $formatTemplate = null ) : mixed
inherited

Provides custom handling for retrieving the properties field of an Element.

Inherited from: \modElement::get()\modChunk::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.

Parameters
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).

Returns
Type Description
mixed The value(s) of the field(s) requested.
methodpublicgetContent( array $options = array() ) : string
inherited

Gets the raw, unprocessed source content for this element.

Inherited from: \modElement::getContent()\modChunk::getContent()
Parameters
Name Type Description
$options array

An array of options implementations can use to accept language, revision identifiers, or other information to alter the behavior of the method.

Returns
Type Description
string The raw source content for the element.
methodpublicgetFKClass( string $k ) : void
inherited

Get the name of a class related by foreign key to a specified field key.

Inherited from: \xPDOObject::getFKClass()\modAccessibleObject::getFKClass()\modAccessibleSimpleObject::getFKClass()\modElement::getFKClass()\modChunk::getFKClass()

This is generally used to lookup classes involved in one-to-one relationships with the current object.

Parameters
Name Type Description
$k string

The field name or key to lookup a related class for.

methodpublicgetFKDefinition( string $alias ) : array

This is generally used to lookup classes in a one-to-many relationship with the current object.

Parameters
Name Type Description
$alias string

Alias of the related class to lookup a foreign key definition from.

Returns
Type Description
array A foreign key definition.
methodpublicgetField( string $key, bool $validate = false ) : string | bool
inherited

Get a field name, looking up any by alias if not an actual field.

Inherited from: \xPDOObject::getField()\modAccessibleObject::getField()\modAccessibleSimpleObject::getField()\modElement::getField()\modChunk::getField()
Parameters
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.

Returns
Type Description
string | bool The actual field name, the key as passed, or false if not a field or alias and validate is true.
methodpublicgetFieldName( string $k, string $alias = null ) : string

This gets the name of the field, fully-qualified by either the object table name or a specified alias, and properly quoted.

Parameters
Name Type Description
$k string

The simple name of the field.

$alias string

An optional alias for the table in a specific query.

Returns
Type Description
string The name of the field, qualified with the table name or an optional table alias.
methodpublicgetFileContent( array $options = array() ) : bool | string
inherited

Get the content stored in an external file for this instance.

Inherited from: \modElement::getFileContent()\modChunk::getFileContent()
Parameters
Name Type Description
$options array

An array of options.

Returns
Type Description
bool | string The content or false if the content could not be retrieved.
methodpublicgetGraph( boolean | string | array | integer $graph = true, \xPDOCriteria | array | string | integer $criteria = null, boolean | integer $cacheFlag = true ) : array | boolean
Parameters
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.

Returns
Type Description
array | boolean The graph that was loaded or false if nothing was loaded.
methodpublicgetInputFilter( ) : \modInputFilter | null
inherited

Get an input filter instance configured for this Element.

Inherited from: \modElement::getInputFilter()\modChunk::getInputFilter()
Returns
Type Description
\modInputFilter | null An input filter instance (or null if one cannot be loaded).
methodpublicgetIterator( string $alias, null | array | \xPDOCriteria $criteria = null, bool | int $cacheFlag = true ) : bool | \xPDOIterator
inherited

Get an xPDOIterator for a collection of objects related by aggregate or composite relations.

Inherited from: \xPDOObject::getIterator()\modAccessibleObject::getIterator()\modAccessibleSimpleObject::getIterator()\modElement::getIterator()\modChunk::getIterator()
Parameters
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.

Returns
Type Description
bool | \xPDOIterator An iterator for the collection or false if no relation is found.
methodpublicgetMany( string $alias, object $criteria = null, boolean | integer $cacheFlag = true ) : array
inherited

Gets a collection of objects related by aggregate or composite relations.

Inherited from: \xPDOObject::getMany()\modAccessibleObject::getMany()\modAccessibleSimpleObject::getMany()\modElement::getMany()\modChunk::getMany()
Parameters
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.

Returns
Type Description
array A collection of related objects or an empty array.
Details
See
\xPDOObject::getOne()  
See
\xPDOObject::addOne()  
See
\xPDOObject::addMany()  
methodpublicgetOne( string $alias, object $criteria = null, boolean | integer $cacheFlag = true ) : \xPDOObject | null
inherited

Gets an object related to this instance by a foreign key relationship.

Inherited from: \xPDOObject::getOne()\modAccessibleObject::getOne()\modAccessibleSimpleObject::getOne()\modElement::getOne()\modChunk::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()}.

Parameters
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.

Returns
Type Description
\xPDOObject | null The related object or null if no instance exists.
Details
See
\xPDOObject::getMany()  
See
\xPDOObject::addOne()  
See
\xPDOObject::addMany()  
methodpublicgetOption( string $key, array | null $options = null, mixed $default = null ) : mixed
Parameters
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.

Returns
Type Description
mixed The value of the option or the provided default if it is not set.
methodpublicgetOutputFilter( ) : \modOutputFilter | null
inherited

Get an output filter instance configured for this Element.

Inherited from: \modElement::getOutputFilter()\modChunk::getOutputFilter()
Returns
Type Description
\modOutputFilter | null An output filter instance (or null if one cannot be loaded).
methodpublicgetPK( ) : mixed
inherited

Gets the name (or names) of the primary key field(s) for the object.

Inherited from: \xPDOObject::getPK()\modAccessibleObject::getPK()\modAccessibleSimpleObject::getPK()\modElement::getPK()\modChunk::getPK()
Returns
Type Description
mixed The string (or an array of strings) representing the name(s) of the primary key field(s) for this instance.
methodpublicgetPKType( ) : string
Returns
Type Description
string The type of the primary key field for this instance.
methodpublicgetPolicies( ) : array
Returns
Type Description
array
methodpublicgetPrimaryKey( boolean $validateCompound = true ) : mixed
Parameters
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

Returns
Type Description
mixed The string (or an array) representing the value(s) of the primary key field(s) for this instance.
methodpublicgetProperties( array | string $properties = null ) : array
inherited

Get the properties for this element instance for processing.

Inherited from: \modElement::getProperties()\modChunk::getProperties()
Parameters
Name Type Description
$properties array | string

An array or string of properties to apply.

Returns
Type Description
array A simple array of properties ready to use for processing.
methodpublicgetPropertySet( string | null $setName = null ) : array | null
inherited

Gets a named property set related to this element instance.

Inherited from: \modElement::getPropertySet()\modChunk::getPropertySet()

If a setName parameter is not provided, this function will attempt to extract a setName from the element name using the @ symbol to delimit the name of the property set.

Here is an example of an element tag using the @ modifier to specify a property set name: [[ElementName@PropertySetName:FilterCommand=FilterModifier? &PropertyKey1=PropertyValue1 &PropertyKey2=PropertyValue2 ]]

Parameters
Name Type Description
$setName string | null

An explicit property set name to search for.

Returns
Type Description
array | null An array of properties or null if no set is found.
Details
Access
public  
methodpublicgetSelectColumns( \xPDO $xpdo, string $className, string $tableAlias = '', string $columnPrefix = '', array $columns = array (), boolean $exclude = false ) : string
Parameters
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.

Returns
Type Description
string A comma-delimited list of the field names for use in a SELECT clause.
Details
Static
 
methodpublicgetSource( string $contextKey = '', boolean $fallbackToDefault = true ) : \modMediaSource | null
inherited

Get the Source for this Element

Inherited from: \modElement::getSource()\modChunk::getSource()
Parameters
Name Type Description
$contextKey string
$fallbackToDefault boolean
Returns
Type Description
\modMediaSource | null
methodpublicgetSourceCache( string $contextKey = '', array $options = array() ) : array
inherited

Get the stored sourceCache for a context

Inherited from: \modElement::getSourceCache()\modChunk::getSourceCache()
Parameters
Name Type Description
$contextKey string
$options array
Returns
Type Description
array
methodpublicgetSourceFile( array $options = array() ) : string | boolean
inherited

Get the absolute path to the static source file for this instance.

Inherited from: \modElement::getSourceFile()\modChunk::getSourceFile()
Parameters
Name Type Description
$options array

An array of options.

Returns
Type Description
string | boolean The absolute path to the static source file or false if not static.
methodpublicgetSourcePath( array $options = array() ) : string
inherited

Get the absolute path location the source file is located relative to.

Inherited from: \modElement::getSourcePath()\modChunk::getSourcePath()
Parameters
Name Type Description
$options array

An array of options.

Returns
Type Description
string The absolute path the sourceFile is relative to.
methodpublicgetTag( ) : string
inherited

Constructs a valid tag representation of the element.

Inherited from: \modElement::getTag()\modChunk::getTag()
Returns
Type Description
string A tag representation of the element.
methodpublicgetToken( ) : string
inherited

Accessor method for the token class var.

Inherited from: \modElement::getToken()\modChunk::getToken()
Returns
Type Description
string The token for this element tag.
methodpublicgetValidator( ) : string | boolean
Returns
Type Description
string | boolean The xPDOValidator instance or false if it could not be loaded.
methodpublicisCacheable( ) : boolean
inherited

Indicates if the element is cacheable.

Inherited from: \modElement::isCacheable()\modChunk::isCacheable()
Returns
Type Description
boolean True if the element can be stored to or retrieved from the element cache.
Details
Access
public  
methodpublicisDirty( string $key ) : boolean
inherited

Indicates if an object field has been modified (or never saved).

Inherited from: \xPDOObject::isDirty()\modAccessibleObject::isDirty()\modAccessibleSimpleObject::isDirty()\modElement::isDirty()\modChunk::isDirty()
Parameters
Name Type Description
$key string

The field name to check.

Returns
Type Description
boolean True if the field exists and either has been modified or the object is new.
Details
Access
public  
methodpublicisLazy( string $key = '' ) : boolean
Parameters
Name Type Description
$key string

Optional key to check for laziness.

Returns
Type Description
boolean True if the field specified or if any field is lazy if no field is specified.
methodpublicisNew( ) : boolean
inherited

Indicates if the instance is new, and has not yet been persisted.

Inherited from: \xPDOObject::isNew()\modAccessibleObject::isNew()\modAccessibleSimpleObject::isNew()\modElement::isNew()\modChunk::isNew()
Returns
Type Description
boolean True if the object has not been saved or was loaded from the database.
methodpublicisStatic( ) : boolean
inherited

Indicates if the instance has content in an external file.

Inherited from: \modElement::isStatic()\modChunk::isStatic()
Returns
Type Description
boolean True if the instance has content stored in an external file.
methodpublicisStaticSourceMutable( ) : boolean
inherited

Return if the static source is mutable.

Inherited from: \modElement::isStaticSourceMutable()\modChunk::isStaticSourceMutable()
Returns
Type Description
boolean True if the source file is mutable.
methodpublicisStaticSourceValidPath( ) : boolean
inherited

Ensure the static source cannot browse the protected configuration directory

Inherited from: \modElement::isStaticSourceValidPath()\modChunk::isStaticSourceValidPath()
Returns
Type Description
boolean True if is a valid source path
methodpublicisValidated( string $key = '' ) : boolean
Parameters
Name Type Description
$key string

Optional key to check for specific validation.

Returns
Type Description
boolean True if the object or specified field has been fully validated successfully.
methodpublicload( \xPDO $xpdo, string $className, mixed $criteria, boolean | integer $cacheFlag = true ) : object | null
staticinherited

Custom instance loader that forces access policy checking.

Inherited from: \modAccessibleObject::load()\modAccessibleSimpleObject::load()\modElement::load()\modChunk::load()

Parameters
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.

Returns
Type Description
object | null An instance of the requested class, or null if it could not be instantiated.
methodpublicloadCollection( \xPDO $xpdo, string $className, mixed $criteria = null, boolean | integer $cacheFlag = true ) : array
staticinherited

Custom collection loader that forces access policy checking.

Inherited from: \modAccessibleObject::loadCollection()\modAccessibleSimpleObject::loadCollection()\modElement::loadCollection()\modChunk::loadCollection()

Parameters
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.

Returns
Type Description
array An array of xPDOObject instances or an empty array if no instances are loaded.
methodpublicloadCollectionGraph( \xPDO $xpdo, string $className, string | array $graph, mixed $criteria, boolean | integer $cacheFlag ) : array
Parameters
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.

Returns
Type Description
array An array of xPDOObject instances or an empty array if no instances are loaded.
Details
Static
 
methodpublicprocess( array | string $properties = null, string $content = null ) : mixed
inherited

Overrides modElement::process to initialize the Chunk into the element cache, as well as set placeholders and filter the output.

Inherited from: \modChunk::process()

Parameters
Name Type Description
$properties array | string

A set of configuration properties for the element.

$content string

Optional content to use in place of any persistent content associated with the element.

Returns
Type Description
mixed The result of processing.
methodpublicremove( array $ancestors = array () ) : boolean
inherited

Overrides modElement::remove to add custom error logging and fire modX-specific events.

Inherited from: \modChunk::remove()

Deletes the persistent object isntance stored in the database when called, including any dependent objects defined by composite foreign key relationships.

Parameters
Name Type Description
$ancestors array

Keeps track of classes which have already been removed to prevent loop with circular references.

Returns
Type Description
boolean Returns true on success, false on failure.
methodpublicremovePropertySet( string | \modPropertySet $propertySet ) : boolean
inherited

Remove a property set from this element, making it unavailable for use.

Inherited from: \modElement::removePropertySet()\modChunk::removePropertySet()
Parameters
Name Type Description
$propertySet string | \modPropertySet

A modPropertySet object or the name of a modPropertySet object to dissociate from.

Returns
Type Description
boolean True if a relationship was destroyed.
Details
Access
public  
methodpublicremoveValidationRules( string $field = null, array $rules = array() ) : void
Parameters
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.

methodpublicsave( boolean | integer $cacheFlag = null ) : boolean
inherited

Overrides modElement::save to add custom error logging and fire modX-specific events.

Inherited from: \modChunk::save()

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.

Parameters
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).

Returns
Type Description
boolean Returns true on success, false on failure.
methodpublicset( string $k, mixed $v = null, string | \callable $vType = '' ) : boolean
Parameters
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.

Returns
Type Description
boolean Determines whether the value was set successfully and was determined to be dirty (i.e. different from the previous value).
methodpublicsetCacheable( boolean $cacheable = true ) : void
inherited

Sets the runtime cacheability of the element.

Inherited from: \modElement::setCacheable()\modChunk::setCacheable()
Parameters
Name Type Description
$cacheable boolean

Indicates the value to set for cacheability of this element.

Details
Access
public  
methodpublicsetContent( mixed $content, array $options = array() ) : boolean
inherited

Set the raw source content for this element.

Inherited from: \modElement::setContent()\modChunk::setContent()
Parameters
Name Type Description
$content mixed

The source content; implementations can decide if it can only be a string, or some other source from which to retrieve it.

$options array

An array of options implementations can use to accept language, revision identifiers, or other information to alter the behavior of the method.

Returns
Type Description
boolean True indicates the content was set.
methodpublicsetDirty( string $key = '' ) : void
inherited

Add the field to a collection of field keys that have been modified.

Inherited from: \xPDOObject::setDirty()\modAccessibleObject::setDirty()\modAccessibleSimpleObject::setDirty()\modElement::setDirty()\modChunk::setDirty()

This function also clears any validation flag associated with the field.

Parameters
Name Type Description
$key string

The key of the field to set dirty.

methodpublicsetFileContent( string $content, array $options = array() ) : bool | int
inherited

Set external file content from this instance.

Inherited from: \modElement::setFileContent()\modChunk::setFileContent()
Parameters
Name Type Description
$content string

The content to set.

$options array

An array of options.

Returns
Type Description
bool | int The number of bytes written to file or false on failure.
methodpublicsetOption( string $key, mixed $value ) : void
Parameters
Name Type Description
$key string

The option key to set a value for.

$value mixed

A value to assign to the option.

methodpublicsetPolicies( array $policies = array() ) : void
Parameters
Name Type Description
$policies array
methodpublicsetProperties( array | string $properties, boolean $merge = false ) : boolean
inherited

Set default properties for this element instance.

Inherited from: \modElement::setProperties()\modChunk::setProperties()
Parameters
Name Type Description
$properties array | string

A property array or property string.

$merge boolean

Indicates if properties should be merged with existing ones.

Returns
Type Description
boolean true if the properties are set.
Details
Access
public  
methodpublicsetSource( string $source ) : void
inherited

Setter method for the source class var.

Inherited from: \modElement::setSource()\modChunk::setSource()
Parameters
Name Type Description
$source string

The source to use for this element.

methodpublicsetTag( string $tag ) : void
inherited

Setter method for the tag class var.

Inherited from: \modElement::setTag()\modChunk::setTag()
Parameters
Name Type Description
$tag string

The tag to use for this element.

methodpublicsetToken( string $token ) : void
inherited

Setter method for the token class var.

Inherited from: \modElement::setToken()\modChunk::setToken()
Parameters
Name Type Description
$token string

The token to use for this element tag.

methodpublicstaticContentChanged( ) : boolean
inherited

Indicates if the content has changed and the Element has a mutable static source.

Inherited from: \modElement::staticContentChanged()\modChunk::staticContentChanged()
Returns
Type Description
boolean
methodpublicstaticSourceChanged( ) : boolean
inherited

Indicates if the static source has changed.

Inherited from: \modElement::staticSourceChanged()\modChunk::staticSourceChanged()
Returns
Type Description
boolean
methodpublictoArray( string $keyPrefix = '', boolean $rawValues = false, boolean $excludeLazy = false, boolean | integer | string | array $includeRelated = false ) : array
inherited

Copies the object fields and corresponding values to an associative array.

Inherited from: \xPDOObject::toArray()\modAccessibleObject::toArray()\modAccessibleSimpleObject::toArray()\modElement::toArray()\modChunk::toArray()
Parameters
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.

Returns
Type Description
array An array representation of the object fields/values.
methodpublictoJSON( string $keyPrefix = '', boolean $rawValues = false ) : string
Parameters
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()}.

Returns
Type Description
string A JSON string representing the object.
methodpublicvalidate( array $options = array() ) : boolean
Parameters
Name Type Description
$options array

An array of options to pass to the validator.

Returns
Type Description
boolean True if validation was successful.
Documentation was generated by DocBlox 0.18.1.