core/model/modx/sqlsrv/modstaticresource.class.php

Show: inherited
Table of Contents

Package
modx  
Subpackage
sqlsrv  

\modStaticResource_sqlsrv

Package: modx\sqlsrv

A derivative of modResource that stores content on the filesystem.

This is the basis for the entire xPDO object model, and can also be used by a class generator {@link xPDOGenerator}, ultimately allowing custom classes to be user-defined in a web interface and framework-generated at runtime.

Parent(s)
\modStaticResource < \modResourceInterface < \modResourceInterface < \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
\modResource::$$_aggregates  
Inherited_from
\modStaticResource::$$_aggregates  
Propertypublicstring  $_alias= 'null'
Default valuenullDetails
Type
string
Inherited_from
\xPDOObject::$$_alias  
Inherited_from
\modAccessibleObject::$$_alias  
Inherited_from
\modAccessibleSimpleObject::$$_alias  
Inherited_from
\modResource::$$_alias  
Inherited_from
\modStaticResource::$$_alias  
Propertypublicboolean  $_cacheFlag= 'true'
Default valuetrueDetails
Type
boolean
Inherited_from
\xPDOObject::$$_cacheFlag  
Inherited_from
\modAccessibleObject::$$_cacheFlag  
Inherited_from
\modAccessibleSimpleObject::$$_cacheFlag  
Inherited_from
\modResource::$$_cacheFlag  
Inherited_from
\modStaticResource::$$_cacheFlag  
Propertypublicstring  $_cacheKey= 'null'
inherited

The cache filename for the resource in the context.

Inherited from: \modResource::$$_cacheKey\modStaticResource::$$_cacheKey
Default valuenullDetails
Type
string
Inherited_from
\modResource::$$_cacheKey  
Inherited_from
\modStaticResource::$$_cacheKey  
Propertypublicstring  $_class= 'null'
Default valuenullDetails
Type
string
Inherited_from
\xPDOObject::$$_class  
Inherited_from
\modAccessibleObject::$$_class  
Inherited_from
\modAccessibleSimpleObject::$$_class  
Inherited_from
\modResource::$$_class  
Inherited_from
\modStaticResource::$$_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
\modResource::$$_composites  
Inherited_from
\modStaticResource::$$_composites  
Propertypublicstring  $_content= ''''
inherited

Represents the cacheable content for a resource.

Inherited from: \modResource::$$_content\modStaticResource::$$_content

Note that this is not the raw source content, but the content that is the result of processing cacheable tags within the raw source content.

Default value''Details
Type
string
Inherited_from
\modResource::$$_content  
Inherited_from
\modStaticResource::$$_content  
Propertypublicstring  $_contextKey= 'null'
inherited

The context the resource is requested from.

Inherited from: \modResource::$$_contextKey\modStaticResource::$$_contextKey

Note that this is different than the context_key field that describes a primary context for the resource.

Default valuenullDetails
Type
string
Inherited_from
\modResource::$$_contextKey  
Inherited_from
\modStaticResource::$$_contextKey  
Propertypublicarray  $_dirty= 'array ()'
Default valuearray ()Details
Type
array
Access
public  
Inherited_from
\xPDOObject::$$_dirty  
Inherited_from
\modAccessibleObject::$$_dirty  
Inherited_from
\modAccessibleSimpleObject::$$_dirty  
Inherited_from
\modResource::$$_dirty  
Inherited_from
\modStaticResource::$$_dirty  
Propertypublicarray  $_fieldAliases= 'array()'
Default valuearray()Details
Type
array
Inherited_from
\xPDOObject::$$_fieldAliases  
Inherited_from
\modAccessibleObject::$$_fieldAliases  
Inherited_from
\modAccessibleSimpleObject::$$_fieldAliases  
Inherited_from
\modResource::$$_fieldAliases  
Inherited_from
\modStaticResource::$$_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
\modResource::$$_fieldMeta  
Inherited_from
\modStaticResource::$$_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\modResource::$$_fields\modStaticResource::$$_fields
Default valuearray ()Details
Type
array
Access
public  
Inherited_from
\xPDOObject::$$_fields  
Inherited_from
\modAccessibleObject::$$_fields  
Inherited_from
\modAccessibleSimpleObject::$$_fields  
Inherited_from
\modResource::$$_fields  
Inherited_from
\modStaticResource::$$_fields  
Propertypublicboolean  $_isForward= 'false'
inherited

Indicates if this Resource was generated from a forward.

Inherited from: \modResource::$$_isForward\modStaticResource::$$_isForward
Default valuefalseDetails
Type
boolean
Inherited_from
\modResource::$$_isForward  
Inherited_from
\modStaticResource::$$_isForward  
Propertypublicarray  $_jscripts= 'array()'
inherited

An array of Javascript/CSS to be appended to the footer of this Resource

Inherited from: \modResource::$$_jscripts\modStaticResource::$$_jscripts
Default valuearray()Details
Type
array
Inherited_from
\modResource::$$_jscripts  
Inherited_from
\modStaticResource::$$_jscripts  
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\modResource::$$_lazy\modStaticResource::$$_lazy
Default valuearray ()Details
Type
array
Access
public  
Inherited_from
\xPDOObject::$$_lazy  
Inherited_from
\modAccessibleObject::$$_lazy  
Inherited_from
\modAccessibleSimpleObject::$$_lazy  
Inherited_from
\modResource::$$_lazy  
Inherited_from
\modStaticResource::$$_lazy  
Propertypublicarray  $_loadedjscripts= 'array()'
inherited

All loaded Javascript/CSS that has been calculated to be loaded

Inherited from: \modResource::$$_loadedjscripts\modStaticResource::$$_loadedjscripts
Default valuearray()Details
Type
array
Inherited_from
\modResource::$$_loadedjscripts  
Inherited_from
\modStaticResource::$$_loadedjscripts  
Propertypublicboolean  $_new= 'true'
Default valuetrueDetails
Type
boolean
Access
public  
Inherited_from
\xPDOObject::$$_new  
Inherited_from
\modAccessibleObject::$$_new  
Inherited_from
\modAccessibleSimpleObject::$$_new  
Inherited_from
\modResource::$$_new  
Inherited_from
\modStaticResource::$$_new  
Propertypublicarray  $_options= 'array()'
Default valuearray()Details
Type
array
Inherited_from
\xPDOObject::$$_options  
Inherited_from
\modAccessibleObject::$$_options  
Inherited_from
\modAccessibleSimpleObject::$$_options  
Inherited_from
\modResource::$$_options  
Inherited_from
\modStaticResource::$$_options  
Propertypublicstring  $_output= ''''
inherited

Represents the output the resource produces.

Inherited from: \modResource::$$_output\modStaticResource::$$_output
Default value''Details
Type
string
Inherited_from
\modResource::$$_output  
Inherited_from
\modStaticResource::$$_output  
Propertypublicstring  $_package= 'null'
Default valuenullDetails
Type
string
Inherited_from
\xPDOObject::$$_package  
Inherited_from
\modAccessibleObject::$$_package  
Inherited_from
\modAccessibleSimpleObject::$$_package  
Inherited_from
\modResource::$$_package  
Inherited_from
\modStaticResource::$$_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\modResource::$$_pk\modStaticResource::$$_pk
Default valuenullDetails
Type
string | array
Access
public  
Inherited_from
\xPDOObject::$$_pk  
Inherited_from
\modAccessibleObject::$$_pk  
Inherited_from
\modAccessibleSimpleObject::$$_pk  
Inherited_from
\modResource::$$_pk  
Inherited_from
\modStaticResource::$$_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
\modResource::$$_pktype  
Inherited_from
\modStaticResource::$$_pktype  
Propertyprotectedarray  $_policies= 'array()'
Default valuearray()Details
Type
array
Inherited_from
\modAccessibleObject::$$_policies  
Inherited_from
\modAccessibleSimpleObject::$$_policies  
Inherited_from
\modResource::$$_policies  
Inherited_from
\modStaticResource::$$_policies  
Propertyprotectedboolean  $_processed= 'false'
inherited

Indicates if the resource has already been processed.

Inherited from: \modResource::$$_processed\modStaticResource::$$_processed
Default valuefalseDetails
Type
boolean
Inherited_from
\modResource::$$_processed  
Inherited_from
\modStaticResource::$$_processed  
Propertyprotectedboolean  $_refreshCache= 'true'
inherited

Indicates if the site cache should be refreshed when saving changes.

Inherited from: \modResource::$$_refreshCache\modStaticResource::$$_refreshCache
Default valuetrueDetails
Type
boolean
Inherited_from
\modResource::$$_refreshCache  
Inherited_from
\modStaticResource::$$_refreshCache  
Propertypublicarray  $_relatedObjects= 'array ()'
Default valuearray ()Details
Type
array
Access
public  
Inherited_from
\xPDOObject::$$_relatedObjects  
Inherited_from
\modAccessibleObject::$$_relatedObjects  
Inherited_from
\modAccessibleSimpleObject::$$_relatedObjects  
Inherited_from
\modResource::$$_relatedObjects  
Inherited_from
\modStaticResource::$$_relatedObjects  
Propertypublicarray  $_sjscripts= 'array()'
inherited

An array of Javascript/CSS to be appended to the HEAD of this Resource

Inherited from: \modResource::$$_sjscripts\modStaticResource::$$_sjscripts
Default valuearray()Details
Type
array
Inherited_from
\modResource::$$_sjscripts  
Inherited_from
\modStaticResource::$$_sjscripts  
Propertyprotectedstring  $_sourceFile= ''''
inherited

Path of the file containing the source content, relative to the {@link modStaticResource::$_sourcePath}.Inherited from: \modStaticResource::$$_sourceFile
Default value''Details
Type
string
Inherited_from
\modStaticResource::$$_sourceFile  
Propertyprotectedinteger  $_sourceFileSize= '0'
inherited

Size of the source file content in bytes.Inherited from: \modStaticResource::$$_sourceFileSize
Default value0Details
Type
integer
Inherited_from
\modStaticResource::$$_sourceFileSize  
Propertyprotectedstring  $_sourcePath= ''''
inherited

An absolute base filesystem path where the source file exists.Inherited from: \modStaticResource::$$_sourcePath
Default value''Details
Type
string
Inherited_from
\modStaticResource::$$_sourcePath  
Propertypublicstring  $_table= 'null'
Default valuenullDetails
Type
string
Access
public  
Inherited_from
\xPDOObject::$$_table  
Inherited_from
\modAccessibleObject::$$_table  
Inherited_from
\modAccessibleSimpleObject::$$_table  
Inherited_from
\modResource::$$_table  
Inherited_from
\modStaticResource::$$_table  
Propertypublicstring  $_tableMeta= 'null'
Default valuenullDetails
Type
string
Access
public  
Inherited_from
\xPDOObject::$$_tableMeta  
Inherited_from
\modAccessibleObject::$$_tableMeta  
Inherited_from
\modAccessibleSimpleObject::$$_tableMeta  
Inherited_from
\modResource::$$_tableMeta  
Inherited_from
\modStaticResource::$$_tableMeta  
Propertypublicarray  $_validated= 'array ()'
Default valuearray ()Details
Type
array
Access
public  
Inherited_from
\xPDOObject::$$_validated  
Inherited_from
\modAccessibleObject::$$_validated  
Inherited_from
\modAccessibleSimpleObject::$$_validated  
Inherited_from
\modResource::$$_validated  
Inherited_from
\modStaticResource::$$_validated  
Propertypublicboolean  $_validationLoaded= 'false'
Default valuefalseDetails
Type
boolean
Access
public  
Inherited_from
\xPDOObject::$$_validationLoaded  
Inherited_from
\modAccessibleObject::$$_validationLoaded  
Inherited_from
\modAccessibleSimpleObject::$$_validationLoaded  
Inherited_from
\modResource::$$_validationLoaded  
Inherited_from
\modStaticResource::$$_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
\modResource::$$_validationRules  
Inherited_from
\modStaticResource::$$_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
\modResource::$$_validator  
Inherited_from
\modStaticResource::$$_validator  
Propertypublicboolean  $allowChildrenResources= 'true'
inherited

Whether or not to allow creation of children resources in tree. Can be overridden in a derivative Resource class.

Inherited from: \modResource::$$allowChildrenResources\modStaticResource::$$allowChildrenResources
Default valuetrueDetails
Type
boolean
Inherited_from
\modResource::$$allowChildrenResources  
Inherited_from
\modStaticResource::$$allowChildrenResources  
Propertypublicboolean  $allowListingInClassKeyDropdown= 'true'
inherited

Use if extending modResource to state whether or not the derivative class can be listed in the class_key dropdown users can change when editing a resource.

Inherited from: \modResource::$$allowListingInClassKeyDropdown\modStaticResource::$$allowListingInClassKeyDropdown
Default valuetrueDetails
Type
boolean
Inherited_from
\modResource::$$allowListingInClassKeyDropdown  
Inherited_from
\modStaticResource::$$allowListingInClassKeyDropdown  
Propertypublicstring  $container= 'null'
Default valuenullDetails
Type
string
Access
public  
Inherited_from
\xPDOObject::$$container  
Inherited_from
\modAccessibleObject::$$container  
Inherited_from
\modAccessibleSimpleObject::$$container  
Inherited_from
\modResource::$$container  
Inherited_from
\modStaticResource::$$container  
Propertypublicarray  $fieldNames= 'null'

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
\modResource::$$fieldNames  
Inherited_from
\modStaticResource::$$fieldNames  
Propertypublicboolean  $showInContextMenu= 'false'
inherited

Use if extending modResource to state whether or not to show the extended class in the tree context menu

Inherited from: \modResource::$$showInContextMenu\modStaticResource::$$showInContextMenu
Default valuefalseDetails
Type
boolean
Inherited_from
\modResource::$$showInContextMenu  
Inherited_from
\modStaticResource::$$showInContextMenu  
Propertypublic\modX  $xpdo= ''
inherited

A convenience reference to the xPDO object.

Inherited from: \modResource::$$xpdo\modStaticResource::$$xpdo
Details
Type
\modX
Inherited_from
\modResource::$$xpdo  
Inherited_from
\modStaticResource::$$xpdo  

Methods

methodpublic__construct( \xPDO $xpdo ) : \xPDOObject
inherited

Overrides modResource::__construct to set the class key for this Resource type

Inherited from: \modStaticResource::__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_bytes( string $value ) : integer
inherited

Converts to bytes from PHP ini_get() format.

Inherited from: \modStaticResource::_bytes()

PHP ini modifiers for byte values:

  • G = gigabytes
  • M = megabytes
  • K = kilobytes
Parameters
Name Type Description
$value string

Number of bytes represented in PHP ini value format.

Returns
Type Description
integer The value converted to bytes.
Details
Access
protected  
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
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
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.
methodpublicaddLock( integer $user = 0, array $options = array() ) : boolean
inherited

Adds a lock on the Resource

Inherited from: \modResource::addLock()\modStaticResource::addLock()
Parameters
Name Type Description
$user integer
$options array

An array of options for the lock.

Returns
Type Description
boolean True if the lock was successful.
Details
Access
public  
methodpublicaddMany( mixed $obj, string $alias = '' ) : boolean

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( \xPDOObject $obj, string $alias = '' ) : boolean
inherited

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

Inherited from: \modResource::addOne()\modStaticResource::addOne()

Adds legacy support for keeping the existing contentType field in sync when a modContentType is set using this function.

Parameters
Name Type Description
$obj \xPDOObject
$alias string
Returns
Type Description
boolean
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.

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()\modResource::checkPolicy()\modStaticResource::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.
methodpubliccleanAlias( string $alias, array $options = array() ) : string
inherited

Transforms a string to form a valid URL representation.

Inherited from: \modResource::cleanAlias()\modStaticResource::cleanAlias()
Parameters
Name Type Description
$alias string

A string to transform into a valid URL representation.

$options array

Options to append to or override configuration settings.

Returns
Type Description
string The transformed string.
methodpublicduplicate( array $options = array() ) : mixed
inherited

Duplicate the Resource.

Inherited from: \modResource::duplicate()\modStaticResource::duplicate()
Parameters
Name Type Description
$options array

An array of options.

Returns
Type Description
mixed Returns either an error message, or the newly created modResource object.
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.
methodpublicfindPolicy( string $context = '' ) : array
inherited

Loads the access control policies applicable to this resource.

Inherited from: \modResource::findPolicy()\modStaticResource::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
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

Get a field value (or a set of values) by the field key(s) or name(s).

Inherited from: \xPDOObject::get()\modAccessibleObject::get()\modAccessibleSimpleObject::get()\modResource::get()\modStaticResource::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.
methodpublicgetAliasPath( string $alias = '', array $fields = array() ) : string
inherited

Get the Resource's full alias path.

Inherited from: \modResource::getAliasPath()\modStaticResource::getAliasPath()
Parameters
Name Type Description
$alias string

Optional. The alias to check. If not set, will then build it from the pagetitle if automatic_alias is set to true.

$fields array

Optional. An array of field values to use instead of using the current modResource fields.

Returns
Type Description
string
methodpublicgetCacheKey( ) : string
inherited

Returns the cache key for this instance in the current context.

Inherited from: \modResource::getCacheKey()\modStaticResource::getCacheKey()
Returns
Type Description
string The cache key.
methodpublicgetContent( array $options = array() ) : string
inherited

Treats the local content as a filename to load the raw content from.

Inherited from: \modStaticResource::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 resource.
methodpublicgetContextMenuText( ) : array
inherited

Use this in your extended Resource class to display the text for the context menu item, if showInContextMenu is set to true.

Inherited from: \modStaticResource::getContextMenuText()
Returns
Type Description
array
methodpublicgetControllerPath( \xPDO $modx ) : string
staticinherited

Sets the path to the Static Resource manager controller

Inherited from: \modStaticResource::getControllerPath()
Parameters
Name Type Description
$modx \xPDO

A reference to the modX instance

Returns
Type Description
string
Details
Static
 
methodpublicgetFKClass( string $k ) : void

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
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( string $file, array $options = array() ) : string
inherited

Retrieve the resource content stored in a physical file.

Inherited from: \modStaticResource::getFileContent()
Parameters
Name Type Description
$file string

A path to the file representing the resource content.

$options array
Returns
Type Description
string The content of the file, of false if it 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.
methodpublicgetGroupsList( array $sort = array('id' => 'ASC'), int $limit = 0, int $offset = 0 ) : array
inherited

Gets a sortable, limitable collection (and total count) of Resource Groups for the Resource.

Inherited from: \modResource::getGroupsList()\modStaticResource::getGroupsList()
Parameters
Name Type Description
$sort array

An array of sort columns in column => direction format.

$limit int

A limit of records to retrieve in the collection.

$offset int

A record offset for a limited collection.

Returns
Type Description
array An array containing the collection and total.
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()\modResource::getIterator()\modStaticResource::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.
methodpublicgetLock( ) : int
inherited

Gets the lock on the Resource.

Inherited from: \modResource::getLock()\modStaticResource::getLock()
Returns
Type Description
int
Details
Access
public  
methodpublicgetMany( string $alias, object $criteria = null, boolean | integer $cacheFlag = false ) : array
inherited

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

Inherited from: \modResource::getMany()\modStaticResource::getMany()

Includes special handling for related objects with alias {@link modTemplateVar}, respecting framework security unless specific criteria are provided.

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.
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()\modResource::getOne()\modStaticResource::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.
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()\modResource::getPK()\modStaticResource::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.
methodpublicgetProcessed( ) : boolean
inherited

Return whether or not the resource has been processed.

Inherited from: \modResource::getProcessed()\modStaticResource::getProcessed()
Returns
Type Description
boolean
Details
Access
public  
methodpublicgetProperties( string $namespace = 'core' ) : array
inherited

Get the properties for the specific namespace for the Resource

Inherited from: \modResource::getProperties()\modStaticResource::getProperties()
Parameters
Name Type Description
$namespace string
Returns
Type Description
array
methodpublicgetProperty( string $key, string $namespace = 'core', null $default = null ) : null
inherited

Get a namespaced property for the Resource

Inherited from: \modResource::getProperty()\modStaticResource::getProperty()
Parameters
Name Type Description
$key string
$namespace string
$default null
Returns
Type Description
null
methodpublicgetResourceTypeName( ) : string
inherited

Use this in your extended Resource class to return a translatable name for the Resource Type.

Inherited from: \modStaticResource::getResourceTypeName()
Returns
Type Description
string
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
 
methodpublicgetSourceFile( array $options = array() ) : string
inherited

Get the absolute path to the static source file represented by this instance.

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

An array of options.

Returns
Type Description
string The absolute path to the static source file.
methodpublicgetSourceFileSize( array $options = array() ) : integer
inherited

Get the filesize of the static source file represented by this instance.

Inherited from: \modStaticResource::getSourceFileSize()
Parameters
Name Type Description
$options array

An array of options.

Returns
Type Description
integer The filesize of the source file in bytes.
methodpublicgetTVValue( mixed $pk ) : \null/mixed
inherited

Gets the value of a TV for the Resource.

Inherited from: \modResource::getTVValue()\modStaticResource::getTVValue()
Parameters
Name Type Description
$pk mixed

Either the ID of the TV, or the name of the TV.

Returns
Type Description
\null/mixed The value of the TV for the Resource, or null if the TV is not found.
Details
Access
public  
methodpublicgetTemplateVarCollection( \modResource $resource ) : \A
staticinherited

Retrieve a collection of Template Variables for a Resource.

Inherited from: \modResource::getTemplateVarCollection()\modStaticResource::getTemplateVarCollection()
Parameters
Name Type Description
$resource \modResource

&$resource A reference to the modResource to retrieve TemplateVars for.

Returns
Type Description
\A collection of modTemplateVar instances for the modResource.
Details
Static
 
methodpublicgetTemplateVars( ) : array
inherited

Get a collection of the Template Variable values for the Resource.

Inherited from: \modResource::getTemplateVars()\modStaticResource::getTemplateVars()
Returns
Type Description
array A collection of TemplateVar values for this Resource.
methodpublicgetValidator( ) : string | boolean
Returns
Type Description
string | boolean The xPDOValidator instance or false if it could not be loaded.
methodpublichasChildren( ) : integer
inherited

Checks to see if the Resource has children or not. Returns the number of children.

Inherited from: \modResource::hasChildren()\modStaticResource::hasChildren()
Returns
Type Description
integer The number of children of the Resource
Details
Access
public  
methodpublicisDirty( string $key ) : boolean
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  
methodpublicisDuplicateAlias( string $aliasPath = '', string $contextKey = '' ) : mixed
inherited

Tests to see if an alias is a duplicate.

Inherited from: \modResource::isDuplicateAlias()\modStaticResource::isDuplicateAlias()
Parameters
Name Type Description
$aliasPath string

The current full alias path. If none is passed, will build it from the Resource's currently set alias.

$contextKey string

The context to search for a duplicate alias in.

Returns
Type Description
mixed The ID of the Resource using the alias, if a duplicate, otherwise false.
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()\modResource::isNew()\modStaticResource::isNew()
Returns
Type Description
boolean True if the object has not been saved or was loaded from the database.
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.
methodpublicjoinGroup( mixed $resourceGroupPk ) : boolean
inherited

Joins a Resource to a Resource Group

Inherited from: \modResource::joinGroup()\modStaticResource::joinGroup()
Parameters
Name Type Description
$resourceGroupPk mixed

Either the ID, name or object of the Resource Group

Returns
Type Description
boolean True if successful.
Details
Access
public  
methodpublicleaveGroup( int | string | \modResourceGroup $resourceGroupPk ) : boolean
inherited

Removes a Resource from a Resource Group

Inherited from: \modResource::leaveGroup()\modStaticResource::leaveGroup()
Parameters
Name Type Description
$resourceGroupPk int | string | \modResourceGroup

Either the ID, name or object of the Resource Group

Returns
Type Description
boolean True if successful.
Details
Access
public  
methodpubliclistGroups( \modResource $resource, array $sort = array('id' => 'ASC'), int $limit = 0, int $offset = 0 ) : array
staticinherited

Get a sortable, limitable collection (and total count) of Resource Groups for a given Resource.

Inherited from: \modResource::listGroups()\modStaticResource::listGroups()
Parameters
Name Type Description
$resource \modResource

&$resource A reference to the modResource to get the groups from.

$sort array

An array of sort columns in column => direction format.

$limit int

A limit of records to retrieve in the collection.

$offset int

A record offset for a limited collection.

Returns
Type Description
array An array containing the collection and total.
Details
Static
 
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()\modResource::load()\modStaticResource::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

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
 
methodpublicprepareTreeNode( array $node = array() ) : array
inherited

Use this in your extended Resource class to modify the tree node contents

Inherited from: \modResource::prepareTreeNode()\modStaticResource::prepareTreeNode()
Parameters
Name Type Description
$node array
Returns
Type Description
array
methodpublicprocess( ) : string
inherited

Process a resource, transforming source content to output.

Inherited from: \modResource::process()\modStaticResource::process()
Returns
Type Description
string The processed cacheable content of a resource.
methodpublicrefreshURIs( \modX $modx, int $parent = 0, array $options = array() ) : void
staticinherited

Refresh Resource URI fields for children of the specified parent.

Inherited from: \modResource::refreshURIs()\modStaticResource::refreshURIs()
Parameters
Name Type Description
$modx \modX

&$modx A reference to a valid modX instance.

$parent int

The id of a Resource parent to start from (default is 0, the root)

$options array

An array of various options for the method: - resetOverrides: if true, Resources with uri_override set to true will be included - contexts: an optional array of context keys to limit the refresh scope

Details
Static
 
methodpublicremove( array $ancestors = array () ) : boolean

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.
methodpublicremoveLock( int $user = 0 ) : boolean
inherited

Removes all locks on a Resource.

Inherited from: \modResource::removeLock()\modStaticResource::removeLock()
Parameters
Name Type Description
$user int
Returns
Type Description
boolean True if locks were removed.
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 $cacheFlag = null ) : boolean
inherited

Persist new or changed modResource instances to the database container.

Inherited from: \modResource::save()\modStaticResource::save()

If the modResource is new, the createdon and createdby fields will be set using the current time and user authenticated in the context.

If uri is empty or uri_overridden is not set and something has been changed which might affect the Resource's uri, it is (re-)calculated using getAliasPath(). This can be forced recursively by setting refreshURIs to true before calling save().

Parameters
Name Type Description
$cacheFlag boolean
Returns
Type Description
boolean
methodpublicset( string $k, mixed $v = null, string | \callable $vType = '' ) : boolean
inherited

Set a field value by the field key or name.

Inherited from: \modResource::set()\modStaticResource::set()

Additional logic added for the following fields: -alias: Applies {@link modResource::cleanAlias()} -contentType: Calls {@link modResource::addOne()} to sync contentType -content_type: Sets the contentType field appropriately

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).
methodpublicsetContent( mixed $content, array $options = array() ) : boolean
inherited

Set the raw source content for this element.

Inherited from: \modResource::setContent()\modStaticResource::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

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.

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
methodpublicsetProcessed( boolean $processed ) : void
inherited

Set the field indicating the resource has been processed.

Inherited from: \modResource::setProcessed()\modStaticResource::setProcessed()
Parameters
Name Type Description
$processed boolean

Pass true to indicate the Resource has been processed.

methodpublicsetProperties( array $newProperties, string $namespace = 'core', bool $merge = true ) : boolean
inherited

Set properties for a namespace on the Resource, optionally merging them with existing ones.

Inherited from: \modResource::setProperties()\modStaticResource::setProperties()
Parameters
Name Type Description
$newProperties array
$namespace string
$merge bool
Returns
Type Description
boolean
methodpublicsetProperty( string $key, mixed $value, string $namespace = 'core' ) : bool
inherited

Set a namespaced property for the Resource

Inherited from: \modResource::setProperty()\modStaticResource::setProperty()
Parameters
Name Type Description
$key string
$value mixed
$namespace string
Returns
Type Description
bool
methodpublicsetTVValue( mixed $pk, string $value ) : bool
inherited

Sets a value for a TV for this Resource

Inherited from: \modResource::setTVValue()\modStaticResource::setTVValue()
Parameters
Name Type Description
$pk mixed

The TV name or ID to set

$value string

The value to set for the TV

Returns
Type Description
bool Whether or not the TV saved successfully
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()\modResource::toArray()\modStaticResource::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.
methodpublicupdateContextOfChildren( \modX $modx, \modResource $parent, array $options = array() ) : int
staticinherited

Updates the Context of all Children recursively to that of the parent.

Inherited from: \modResource::updateContextOfChildren()\modStaticResource::updateContextOfChildren()
Parameters
Name Type Description
$modx \modX

&$modx A reference to an initialized modX instance.

$parent \modResource

The parent modResource instance.

$options array

An array of options.

Returns
Type Description
int The number of children updated.
Details
Static
 
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.