core/model/modx/modprocessor.class.php
modProcessor
- Package
- modx
\modDeprecatedProcessor
A utility class for pre-2.2-style, or flat file, processors.
{@inheritdoc}
- Parent(s)
- \modProcessor
Properties

array
$properties= 'array()'
The array of properties being passed to this processor
Inherited from: \modProcessor::$$propertiesarray()Details- Type
- array
- Inherited_from
- \modProcessor::$$properties
Methods

__construct(
\modX $modx, array $properties
=
array()
)
:
void
| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX instance |
| $properties | array | An array of properties |

_decodeLiterals(
string $string
)
:
stringDecodes strings encoded by _encodeLiterals to restore JavaScript literals.
Inherited from: \modProcessor::_decodeLiterals()| Name | Type | Description |
|---|---|---|
| $string | string | The JSON-encoded string with encoded literals. |
| Type | Description |
|---|---|
| string | The JSON-encoded string with literals restored. |
- Access
- protected

_encodeLiterals(
mixed $value, integer | string $key
)
:
voidEncodes certain JavaScript literal strings for later decoding.
Inherited from: \modProcessor::_encodeLiterals()| Name | Type | Description |
|---|---|---|
| $value | mixed | &$value A reference to the value to be encoded if it is identified as a literal. |
| $key | integer | string | The array key corresponding to the value. |
- Access
- protected

addFieldError(
string $key, string $message
=
''
)
:
mixed
| Name | Type | Description |
|---|---|---|
| $key | string | |
| $message | string |
| Type | Description |
|---|---|
| mixed |

checkPermissions(
)
:
booleanReturn true here to allow access to this processor.
Inherited from: \modProcessor::checkPermissions()| Type | Description |
|---|---|
| boolean |

failure(
string $msg
=
'', mixed $object
=
null
)
:
array | string
| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\TheReturn the proper instance of the derived class. This can be used to override how MODX loads a processor class; for example, when handling derivative classes with class_key settings.
Inherited from: \modProcessor::getInstance()| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX object. |
| $className | string | The name of the class that is being requested. |
| $properties | array | An array of properties being run with the processor |
| Type | Description |
|---|---|
| \The | class specified by $className |
- Static

getLanguageTopics(
)
:
arrayLoad a collection of Language Topics for this processor.
Inherited from: \modProcessor::getLanguageTopics()Override this in your derivative class to provide the array of topics to load.
| Type | Description |
|---|---|
| array |

getProperties(
)
:
arrayGet an array of properties for this processor
Inherited from: \modProcessor::getProperties()| Type | Description |
|---|---|
| array |

getProperty(
string $k, mixed $default
=
null
)
:
mixed
| Name | Type | Description |
|---|---|---|
| $k | string | |
| $default | mixed |
| Type | Description |
|---|---|
| mixed |

initialize(
)
:
booleanCan be used to provide custom methods prior to processing. Return true to tell MODX that the Processor initialized successfully. If you return anything else, MODX will output that return value as an error message.
Inherited from: \modProcessor::initialize()| Type | Description |
|---|---|
| boolean |

outputArray(
array $array, mixed $count
=
false
)
:
stringReturn arrays of objects (with count) converted to JSON.
Inherited from: \modProcessor::outputArray()The JSON result includes two main elements, total and results. This format is used for list results.
| Name | Type | Description |
|---|---|---|
| $array | array | An array of data objects. |
| $count | mixed | The total number of objects. Used for pagination. |
| Type | Description |
|---|---|
| string | The JSON output. |
- Access
- public

process(
)
:
mixedRather than load a class for processing, include the processor file directly.
Used here for pre-2.2-style processors.
| Type | Description |
|---|---|
| mixed |

processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
stringProcesses a response from a Plugin Event invocation
Inherited from: \modProcessor::processEventResponse()| Name | Type | Description |
|---|---|---|
| $response | array | string | The response generated by the invokeEvent call |
| $separator | string | The separator for each event response |
| Type | Description |
|---|---|
| string | The processed response. |

run(
)
:
\modProcessorResponseRun the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()| Type | Description |
|---|---|
| \modProcessorResponse |

setCheckbox(
string $k, boolean $force
=
false
)
:
int | nullSpecial helper method for handling checkboxes. Only set value if passed or $force is true, and check for a not empty value or string 'false'.
Inherited from: \modProcessor::setCheckbox()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $force | boolean |
| Type | Description |
|---|---|
| int | null |

setDefaultProperties(
array $properties
=
array()
)
:
arraySets default properties that only are set if they don't already exist in the request
Inherited from: \modProcessor::setDefaultProperties()| Name | Type | Description |
|---|---|---|
| $properties | array |
| Type | Description |
|---|---|
| array | The newly merged properties array |

setProperties(
array $properties
)
:
voidSet the runtime properties for the processor
Inherited from: \modProcessor::setProperties()| Name | Type | Description |
|---|---|---|
| $properties | array | The properties, in array and key-value form, to run on this processor |

success(
string $msg
=
'', mixed $object
=
null
)
:
array | string
| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

toJSON(
mixed $data
)
:
stringConverts PHP to JSON with JavaScript literals left in-tact.
Inherited from: \modProcessor::toJSON()JSON does not allow JavaScript literals, but this function encodes certain identifiable literals and decodes them back into literals after modX::toJSON() formats the data.
| Name | Type | Description |
|---|---|---|
| $data | mixed | The PHP data to be converted. |
| Type | Description |
|---|---|
| string | The extended JSON-encoded string. |
- Access
- public

unsetProperty(
string $key
)
:
voidCompletely unset a property from the properties array
Inherited from: \modProcessor::unsetProperty()| Name | Type | Description |
|---|---|---|
| $key | string |
\modDriverSpecificProcessor
A utility class used for defining driver-specific processors
{@inheritdoc}
- Parent(s)
- \modProcessor
- Children
- \modDatabaseTableTruncateProcessor
- \modDatabaseTableOptimizeProcessor
- \modDatabaseTableGetListProcessor
- \modDatabaseTableOptimizeDatabaseProcessor
Properties

array
$properties= 'array()'
The array of properties being passed to this processor
Inherited from: \modProcessor::$$propertiesarray()Details- Type
- array
- Inherited_from
- \modProcessor::$$properties
Methods

__construct(
\modX $modx, array $properties
=
array()
)
:
void
| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX instance |
| $properties | array | An array of properties |

_decodeLiterals(
string $string
)
:
stringDecodes strings encoded by _encodeLiterals to restore JavaScript literals.
Inherited from: \modProcessor::_decodeLiterals()| Name | Type | Description |
|---|---|---|
| $string | string | The JSON-encoded string with encoded literals. |
| Type | Description |
|---|---|
| string | The JSON-encoded string with literals restored. |
- Access
- protected

_encodeLiterals(
mixed $value, integer | string $key
)
:
voidEncodes certain JavaScript literal strings for later decoding.
Inherited from: \modProcessor::_encodeLiterals()| Name | Type | Description |
|---|---|---|
| $value | mixed | &$value A reference to the value to be encoded if it is identified as a literal. |
| $key | integer | string | The array key corresponding to the value. |
- Access
- protected

addFieldError(
string $key, string $message
=
''
)
:
mixed
| Name | Type | Description |
|---|---|---|
| $key | string | |
| $message | string |
| Type | Description |
|---|---|
| mixed |

checkPermissions(
)
:
booleanReturn true here to allow access to this processor.
Inherited from: \modProcessor::checkPermissions()| Type | Description |
|---|---|
| boolean |

failure(
string $msg
=
'', mixed $object
=
null
)
:
array | string
| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\TheReturn the proper instance of the derived class. This can be used to override how MODX loads a processor class; for example, when handling derivative classes with class_key settings.
| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX object. |
| $className | string | The name of the class that is being requested. |
| $properties | array | An array of properties being run with the processor |
| Type | Description |
|---|---|
| \The | class specified by $className |

getLanguageTopics(
)
:
arrayLoad a collection of Language Topics for this processor.
Inherited from: \modProcessor::getLanguageTopics()Override this in your derivative class to provide the array of topics to load.
| Type | Description |
|---|---|
| array |

getProperties(
)
:
arrayGet an array of properties for this processor
Inherited from: \modProcessor::getProperties()| Type | Description |
|---|---|
| array |

getProperty(
string $k, mixed $default
=
null
)
:
mixed
| Name | Type | Description |
|---|---|---|
| $k | string | |
| $default | mixed |
| Type | Description |
|---|---|
| mixed |

initialize(
)
:
booleanCan be used to provide custom methods prior to processing. Return true to tell MODX that the Processor initialized successfully. If you return anything else, MODX will output that return value as an error message.
Inherited from: \modProcessor::initialize()| Type | Description |
|---|---|
| boolean |

outputArray(
array $array, mixed $count
=
false
)
:
stringReturn arrays of objects (with count) converted to JSON.
Inherited from: \modProcessor::outputArray()The JSON result includes two main elements, total and results. This format is used for list results.
| Name | Type | Description |
|---|---|---|
| $array | array | An array of data objects. |
| $count | mixed | The total number of objects. Used for pagination. |
| Type | Description |
|---|---|
| string | The JSON output. |
- Access
- public

process(
)
:
mixedRun the processor and return the result. Override this in your derivative class to provide custom functionality.
Inherited from: \modProcessor::process()Used here for pre-2.2-style processors.
| Type | Description |
|---|---|
| mixed |

processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
stringProcesses a response from a Plugin Event invocation
Inherited from: \modProcessor::processEventResponse()| Name | Type | Description |
|---|---|---|
| $response | array | string | The response generated by the invokeEvent call |
| $separator | string | The separator for each event response |
| Type | Description |
|---|---|
| string | The processed response. |

run(
)
:
\modProcessorResponseRun the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()| Type | Description |
|---|---|
| \modProcessorResponse |

setCheckbox(
string $k, boolean $force
=
false
)
:
int | nullSpecial helper method for handling checkboxes. Only set value if passed or $force is true, and check for a not empty value or string 'false'.
Inherited from: \modProcessor::setCheckbox()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $force | boolean |
| Type | Description |
|---|---|
| int | null |

setDefaultProperties(
array $properties
=
array()
)
:
arraySets default properties that only are set if they don't already exist in the request
Inherited from: \modProcessor::setDefaultProperties()| Name | Type | Description |
|---|---|---|
| $properties | array |
| Type | Description |
|---|---|
| array | The newly merged properties array |

setProperties(
array $properties
)
:
voidSet the runtime properties for the processor
Inherited from: \modProcessor::setProperties()| Name | Type | Description |
|---|---|---|
| $properties | array | The properties, in array and key-value form, to run on this processor |

success(
string $msg
=
'', mixed $object
=
null
)
:
array | string
| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

toJSON(
mixed $data
)
:
stringConverts PHP to JSON with JavaScript literals left in-tact.
Inherited from: \modProcessor::toJSON()JSON does not allow JavaScript literals, but this function encodes certain identifiable literals and decodes them back into literals after modX::toJSON() formats the data.
| Name | Type | Description |
|---|---|---|
| $data | mixed | The PHP data to be converted. |
| Type | Description |
|---|---|
| string | The extended JSON-encoded string. |
- Access
- public

unsetProperty(
string $key
)
:
voidCompletely unset a property from the properties array
Inherited from: \modProcessor::unsetProperty()| Name | Type | Description |
|---|---|---|
| $key | string |
\modObjectCreateProcessor
A utility abstract class for defining create-based processors
{@inheritdoc}
- Parent(s)
- \modObjectProcessor < \modProcessor
- Children
- \modResourceCreateProcessor
- \modUserCreateProcessor
- \modAccessPolicyTemplateCreateProcessor
- \modAccessPolicyCreateProcessor
- \modUserGroupCreateProcessor
- \modFormCustomizationSetCreateProcessor
- \modFormCustomizationProfileCreateProcessor
- \modUserGroupRoleCreateProcessor
- \modSystemSettingsCreateProcessor
- \modContentTypeCreateProcessor
- \modActionCreateProcessor
- \modDashboardWidgetCreateProcessor
- \modDashboardCreateProcessor
- \modContextCreateProcessor
- \modSourceCreateProcessor
- \modNamespaceCreateProcessor
- \modProviderCreateProcessor
- \modPropertySetCreateProcessor
- \modElementCreateProcessor
- \modElementCategoryCreateProcessor
- Abstract
Properties

string
$afterSaveEvent= ''''
''Details- Type
- string

string
$beforeSaveEvent= ''''
''Details- Type
- string

string
$classKey= ''
- Type
- string
- Inherited_from
- \modObjectProcessor::$$classKey

array
$languageTopics= 'array()'
array()Details- Type
- array
- Inherited_from
- \modObjectProcessor::$$languageTopics

\modX
$modx= 'null'
A reference to the modX object.
Inherited from: \modProcessor::$$modx\modObjectProcessor::$$modxnullDetails- Type
- \modX
- Inherited_from
- \modProcessor::$$modx
- Inherited_from
- \modObjectProcessor::$$modx

\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject
- Inherited_from
- \modObjectProcessor::$$object

string
$objectType= ''object''
'object'Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$objectType

string
$path= ''''
The absolute path to this processor
Inherited from: \modProcessor::$$path\modObjectProcessor::$$path''Details- Type
- string
- Inherited_from
- \modProcessor::$$path
- Inherited_from
- \modObjectProcessor::$$path

string
$permission= ''''
''Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$permission

string
$primaryKeyField= ''id''
'id'Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$primaryKeyField

array
$properties= 'array()'
The array of properties being passed to this processor
Inherited from: \modProcessor::$$properties\modObjectProcessor::$$propertiesarray()Details- Type
- array
- Inherited_from
- \modProcessor::$$properties
- Inherited_from
- \modObjectProcessor::$$properties
Methods

__construct(
\modX $modx, array $properties
=
array()
)
:
voidCreates a modProcessor object.
Inherited from: \modProcessor::__construct()\modObjectProcessor::__construct()| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX instance |
| $properties | array | An array of properties |

_decodeLiterals(
string $string
)
:
stringDecodes strings encoded by _encodeLiterals to restore JavaScript literals.
Inherited from: \modProcessor::_decodeLiterals()\modObjectProcessor::_decodeLiterals()| Name | Type | Description |
|---|---|---|
| $string | string | The JSON-encoded string with encoded literals. |
| Type | Description |
|---|---|
| string | The JSON-encoded string with literals restored. |
- Access
- protected

_encodeLiterals(
mixed $value, integer | string $key
)
:
voidEncodes certain JavaScript literal strings for later decoding.
Inherited from: \modProcessor::_encodeLiterals()\modObjectProcessor::_encodeLiterals()| Name | Type | Description |
|---|---|---|
| $value | mixed | &$value A reference to the value to be encoded if it is identified as a literal. |
| $key | integer | string | The array key corresponding to the value. |
- Access
- protected

addFieldError(
string $key, string $message
=
''
)
:
mixedAdd an error to the field
Inherited from: \modProcessor::addFieldError()\modObjectProcessor::addFieldError()| Name | Type | Description |
|---|---|---|
| $key | string | |
| $message | string |
| Type | Description |
|---|---|
| mixed |

afterSave(
)
:
booleanOverride in your derivative class to do functionality before save() is run
| Type | Description |
|---|---|
| boolean |

beforeSave(
)
:
booleanOverride in your derivative class to do functionality after save() is run
| Type | Description |
|---|---|
| boolean |

beforeSet(
)
:
booleanOverride in your derivative class to do functionality before the fields are set on the object
| Type | Description |
|---|---|
| boolean |

checkPermissions(
)
:
booleanReturn true here to allow access to this processor.
Inherited from: \modObjectProcessor::checkPermissions()| Type | Description |
|---|---|
| boolean |

doesAlreadyExist(
array $criteria
)
:
int| Name | Type | Description |
|---|---|---|
| $criteria | array |
| Type | Description |
|---|---|
| int |

failure(
string $msg
=
'', mixed $object
=
null
)
:
array | stringReturn a failure message from the processor.
Inherited from: \modProcessor::failure()\modObjectProcessor::failure()| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

fireBeforeSaveEvent(
)
:
booleanFire before save event. Return true to prevent saving.
| Type | Description |
|---|---|
| boolean |

getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\TheReturn the proper instance of the derived class. This can be used to override how MODX loads a processor class; for example, when handling derivative classes with class_key settings.
Inherited from: \modProcessor::getInstance()\modObjectProcessor::getInstance()| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX object. |
| $className | string | The name of the class that is being requested. |
| $properties | array | An array of properties being run with the processor |
| Type | Description |
|---|---|
| \The | class specified by $className |
- Static

getLanguageTopics(
)
:
arrayLoad a collection of Language Topics for this processor.
Inherited from: \modObjectProcessor::getLanguageTopics()Override this in your derivative class to provide the array of topics to load.
| Type | Description |
|---|---|
| array |

getProperties(
)
:
arrayGet an array of properties for this processor
Inherited from: \modProcessor::getProperties()\modObjectProcessor::getProperties()| Type | Description |
|---|---|
| array |

getProperty(
string $k, mixed $default
=
null
)
:
mixedGet a specific property.
Inherited from: \modProcessor::getProperty()\modObjectProcessor::getProperty()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $default | mixed |
| Type | Description |
|---|---|
| mixed |

hasErrors(
)
:
booleanReturn whether or not the processor has errors
Inherited from: \modProcessor::hasErrors()\modObjectProcessor::hasErrors()| Type | Description |
|---|---|
| boolean |

initialize(
)
:
booleanCan be used to provide custom methods prior to processing. Return true to tell MODX that the Processor initialized successfully. If you return anything else, MODX will output that return value as an error message.
| Type | Description |
|---|---|
| boolean |

outputArray(
array $array, mixed $count
=
false
)
:
stringReturn arrays of objects (with count) converted to JSON.
Inherited from: \modProcessor::outputArray()\modObjectProcessor::outputArray()The JSON result includes two main elements, total and results. This format is used for list results.
| Name | Type | Description |
|---|---|---|
| $array | array | An array of data objects. |
| $count | mixed | The total number of objects. Used for pagination. |
| Type | Description |
|---|---|
| string | The JSON output. |
- Access
- public

process(
)
:
mixedProcess the Object create processor Run the processor and return the result. Override this in your derivative class to provide custom functionality.
Used here for pre-2.2-style processors.
| Type | Description |
|---|---|
| mixed |

processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
stringProcesses a response from a Plugin Event invocation
Inherited from: \modProcessor::processEventResponse()\modObjectProcessor::processEventResponse()| Name | Type | Description |
|---|---|---|
| $response | array | string | The response generated by the invokeEvent call |
| $separator | string | The separator for each event response |
| Type | Description |
|---|---|
| string | The processed response. |

run(
)
:
\modProcessorResponseRun the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()\modObjectProcessor::run()| Type | Description |
|---|---|
| \modProcessorResponse |

setCheckbox(
string $k, boolean $force
=
false
)
:
int | nullSpecial helper method for handling checkboxes. Only set value if passed or $force is true, and check for a not empty value or string 'false'.
Inherited from: \modProcessor::setCheckbox()\modObjectProcessor::setCheckbox()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $force | boolean |
| Type | Description |
|---|---|
| int | null |

setDefaultProperties(
array $properties
=
array()
)
:
arraySets default properties that only are set if they don't already exist in the request
Inherited from: \modProcessor::setDefaultProperties()\modObjectProcessor::setDefaultProperties()| Name | Type | Description |
|---|---|---|
| $properties | array |
| Type | Description |
|---|---|
| array | The newly merged properties array |

setPath(
string $path
)
:
voidSet the path of the processor
Inherited from: \modProcessor::setPath()\modObjectProcessor::setPath()| Name | Type | Description |
|---|---|---|
| $path | string | The absolute path |

setProperties(
array $properties
)
:
voidSet the runtime properties for the processor
Inherited from: \modProcessor::setProperties()\modObjectProcessor::setProperties()| Name | Type | Description |
|---|---|---|
| $properties | array | The properties, in array and key-value form, to run on this processor |

setProperty(
string $k, mixed $v
)
:
voidSet a property value
Inherited from: \modProcessor::setProperty()\modObjectProcessor::setProperty()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $v | mixed |

success(
string $msg
=
'', mixed $object
=
null
)
:
array | stringReturn a success message from the processor.
Inherited from: \modProcessor::success()\modObjectProcessor::success()| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

toJSON(
mixed $data
)
:
stringConverts PHP to JSON with JavaScript literals left in-tact.
Inherited from: \modProcessor::toJSON()\modObjectProcessor::toJSON()JSON does not allow JavaScript literals, but this function encodes certain identifiable literals and decodes them back into literals after modX::toJSON() formats the data.
| Name | Type | Description |
|---|---|---|
| $data | mixed | The PHP data to be converted. |
| Type | Description |
|---|---|
| string | The extended JSON-encoded string. |
- Access
- public

unsetProperty(
string $key
)
:
voidCompletely unset a property from the properties array
Inherited from: \modProcessor::unsetProperty()\modObjectProcessor::unsetProperty()| Name | Type | Description |
|---|---|---|
| $key | string |
\modObjectDuplicateProcessor
A utility abstract class for defining duplicate-based processors
{@inheritdoc}
- Parent(s)
- \modObjectProcessor < \modProcessor
- Children
- \modAccessPolicyTemplateDuplicateProcessor
- \modAccessPolicyDuplicateProcessor
- \modFormCustomizationSetDuplicateProcessor
- \modFormCustomizationProfileDuplicateProcessor
- \modDashboardDuplicateProcessor
- \modContextDuplicateProcessor
- \modSourceDuplicateProcessor
- \modElementDuplicateProcessor
- Abstract
Properties

boolean
$checkSavePermission= 'true'
trueDetails- Type
- boolean

string
$classKey= ''
- Type
- string
- Inherited_from
- \modObjectProcessor::$$classKey

array
$languageTopics= 'array()'
array()Details- Type
- array
- Inherited_from
- \modObjectProcessor::$$languageTopics

\modX
$modx= 'null'
A reference to the modX object.
Inherited from: \modProcessor::$$modx\modObjectProcessor::$$modxnullDetails- Type
- \modX
- Inherited_from
- \modProcessor::$$modx
- Inherited_from
- \modObjectProcessor::$$modx

\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject
- Inherited_from
- \modObjectProcessor::$$object

string
$objectType= ''object''
'object'Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$objectType

string
$path= ''''
The absolute path to this processor
Inherited from: \modProcessor::$$path\modObjectProcessor::$$path''Details- Type
- string
- Inherited_from
- \modProcessor::$$path
- Inherited_from
- \modObjectProcessor::$$path

string
$permission= ''''
''Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$permission

string
$primaryKeyField= ''id''
'id'Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$primaryKeyField

array
$properties= 'array()'
The array of properties being passed to this processor
Inherited from: \modProcessor::$$properties\modObjectProcessor::$$propertiesarray()Details- Type
- array
- Inherited_from
- \modProcessor::$$properties
- Inherited_from
- \modObjectProcessor::$$properties
Methods

__construct(
\modX $modx, array $properties
=
array()
)
:
voidCreates a modProcessor object.
Inherited from: \modProcessor::__construct()\modObjectProcessor::__construct()| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX instance |
| $properties | array | An array of properties |

_decodeLiterals(
string $string
)
:
stringDecodes strings encoded by _encodeLiterals to restore JavaScript literals.
Inherited from: \modProcessor::_decodeLiterals()\modObjectProcessor::_decodeLiterals()| Name | Type | Description |
|---|---|---|
| $string | string | The JSON-encoded string with encoded literals. |
| Type | Description |
|---|---|
| string | The JSON-encoded string with literals restored. |
- Access
- protected

_encodeLiterals(
mixed $value, integer | string $key
)
:
voidEncodes certain JavaScript literal strings for later decoding.
Inherited from: \modProcessor::_encodeLiterals()\modObjectProcessor::_encodeLiterals()| Name | Type | Description |
|---|---|---|
| $value | mixed | &$value A reference to the value to be encoded if it is identified as a literal. |
| $key | integer | string | The array key corresponding to the value. |
- Access
- protected

addFieldError(
string $key, string $message
=
''
)
:
mixedAdd an error to the field
Inherited from: \modProcessor::addFieldError()\modObjectProcessor::addFieldError()| Name | Type | Description |
|---|---|---|
| $key | string | |
| $message | string |
| Type | Description |
|---|---|
| mixed |

afterSave(
)
:
booleanRun any logic after the object has been duplicated
| Type | Description |
|---|---|
| boolean |

alreadyExists(
string $name
)
:
booleanCheck to see if an object already exists with that name
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| boolean |

beforeSave(
)
:
booleanRun any logic before the object has been duplicated. May return false to prevent duplication.
| Type | Description |
|---|---|
| boolean |

beforeSet(
)
:
booleanOverride in your derivative class to do functionality before the fields are set on the object
| Type | Description |
|---|---|
| boolean |

checkPermissions(
)
:
booleanReturn true here to allow access to this processor.
Inherited from: \modObjectProcessor::checkPermissions()| Type | Description |
|---|---|
| boolean |

failure(
string $msg
=
'', mixed $object
=
null
)
:
array | stringReturn a failure message from the processor.
Inherited from: \modProcessor::failure()\modObjectProcessor::failure()| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\TheReturn the proper instance of the derived class. This can be used to override how MODX loads a processor class; for example, when handling derivative classes with class_key settings.
Inherited from: \modProcessor::getInstance()\modObjectProcessor::getInstance()| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX object. |
| $className | string | The name of the class that is being requested. |
| $properties | array | An array of properties being run with the processor |
| Type | Description |
|---|---|
| \The | class specified by $className |
- Static

getLanguageTopics(
)
:
arrayLoad a collection of Language Topics for this processor.
Inherited from: \modObjectProcessor::getLanguageTopics()Override this in your derivative class to provide the array of topics to load.
| Type | Description |
|---|---|
| array |

getProperties(
)
:
arrayGet an array of properties for this processor
Inherited from: \modProcessor::getProperties()\modObjectProcessor::getProperties()| Type | Description |
|---|---|
| array |

getProperty(
string $k, mixed $default
=
null
)
:
mixedGet a specific property.
Inherited from: \modProcessor::getProperty()\modObjectProcessor::getProperty()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $default | mixed |
| Type | Description |
|---|---|
| mixed |

hasErrors(
)
:
booleanReturn whether or not the processor has errors
Inherited from: \modProcessor::hasErrors()\modObjectProcessor::hasErrors()| Type | Description |
|---|---|
| boolean |

initialize(
)
:
booleanCan be used to provide custom methods prior to processing. Return true to tell MODX that the Processor initialized successfully. If you return anything else, MODX will output that return value as an error message.
| Type | Description |
|---|---|
| boolean |

outputArray(
array $array, mixed $count
=
false
)
:
stringReturn arrays of objects (with count) converted to JSON.
Inherited from: \modProcessor::outputArray()\modObjectProcessor::outputArray()The JSON result includes two main elements, total and results. This format is used for list results.
| Name | Type | Description |
|---|---|---|
| $array | array | An array of data objects. |
| $count | mixed | The total number of objects. Used for pagination. |
| Type | Description |
|---|---|
| string | The JSON output. |
- Access
- public

process(
)
:
mixedRun the processor and return the result. Override this in your derivative class to provide custom functionality.
Used here for pre-2.2-style processors.
| Type | Description |
|---|---|
| mixed |

processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
stringProcesses a response from a Plugin Event invocation
Inherited from: \modProcessor::processEventResponse()\modObjectProcessor::processEventResponse()| Name | Type | Description |
|---|---|---|
| $response | array | string | The response generated by the invokeEvent call |
| $separator | string | The separator for each event response |
| Type | Description |
|---|---|
| string | The processed response. |

run(
)
:
\modProcessorResponseRun the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()\modObjectProcessor::run()| Type | Description |
|---|---|
| \modProcessorResponse |

setCheckbox(
string $k, boolean $force
=
false
)
:
int | nullSpecial helper method for handling checkboxes. Only set value if passed or $force is true, and check for a not empty value or string 'false'.
Inherited from: \modProcessor::setCheckbox()\modObjectProcessor::setCheckbox()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $force | boolean |
| Type | Description |
|---|---|
| int | null |

setDefaultProperties(
array $properties
=
array()
)
:
arraySets default properties that only are set if they don't already exist in the request
Inherited from: \modProcessor::setDefaultProperties()\modObjectProcessor::setDefaultProperties()| Name | Type | Description |
|---|---|---|
| $properties | array |
| Type | Description |
|---|---|
| array | The newly merged properties array |

setNewName(
string $name
)
:
stringSet the new name to the new object
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| string |

setPath(
string $path
)
:
voidSet the path of the processor
Inherited from: \modProcessor::setPath()\modObjectProcessor::setPath()| Name | Type | Description |
|---|---|---|
| $path | string | The absolute path |

setProperties(
array $properties
)
:
voidSet the runtime properties for the processor
Inherited from: \modProcessor::setProperties()\modObjectProcessor::setProperties()| Name | Type | Description |
|---|---|---|
| $properties | array | The properties, in array and key-value form, to run on this processor |

setProperty(
string $k, mixed $v
)
:
voidSet a property value
Inherited from: \modProcessor::setProperty()\modObjectProcessor::setProperty()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $v | mixed |

success(
string $msg
=
'', mixed $object
=
null
)
:
array | stringReturn a success message from the processor.
Inherited from: \modProcessor::success()\modObjectProcessor::success()| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

toJSON(
mixed $data
)
:
stringConverts PHP to JSON with JavaScript literals left in-tact.
Inherited from: \modProcessor::toJSON()\modObjectProcessor::toJSON()JSON does not allow JavaScript literals, but this function encodes certain identifiable literals and decodes them back into literals after modX::toJSON() formats the data.
| Name | Type | Description |
|---|---|---|
| $data | mixed | The PHP data to be converted. |
| Type | Description |
|---|---|
| string | The extended JSON-encoded string. |
- Access
- public

unsetProperty(
string $key
)
:
voidCompletely unset a property from the properties array
Inherited from: \modProcessor::unsetProperty()\modObjectProcessor::unsetProperty()| Name | Type | Description |
|---|---|---|
| $key | string |
\modObjectExportProcessor
Utility class for exporting an object
{@inheritdoc}
- Parent(s)
- \modObjectGetProcessor < \modObjectProcessor < \modProcessor
- Children
- \modAccessPolicyTemplateExportProcessor
- \modAccessPolicyExportProcessor
- Abstract
Properties

boolean
$checkViewPermission= 'true'
trueDetails- Type
- boolean
- Inherited_from
- \modObjectGetProcessor::$$checkViewPermission

string
$classKey= ''
- Type
- string
- Inherited_from
- \modObjectProcessor::$$classKey
- Inherited_from
- \modObjectGetProcessor::$$classKey

array
$languageTopics= 'array()'
array()Details- Type
- array
- Inherited_from
- \modObjectProcessor::$$languageTopics
- Inherited_from
- \modObjectGetProcessor::$$languageTopics

\modX
$modx= 'null'
A reference to the modX object.
Inherited from: \modProcessor::$$modx\modObjectProcessor::$$modx\modObjectGetProcessor::$$modxnullDetails- Type
- \modX
- Inherited_from
- \modProcessor::$$modx
- Inherited_from
- \modObjectProcessor::$$modx
- Inherited_from
- \modObjectGetProcessor::$$modx

\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject
- Inherited_from
- \modObjectProcessor::$$object
- Inherited_from
- \modObjectGetProcessor::$$object

string
$objectType= ''object''
'object'Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$objectType
- Inherited_from
- \modObjectGetProcessor::$$objectType

string
$path= ''''
The absolute path to this processor
Inherited from: \modProcessor::$$path\modObjectProcessor::$$path\modObjectGetProcessor::$$path''Details- Type
- string
- Inherited_from
- \modProcessor::$$path
- Inherited_from
- \modObjectProcessor::$$path
- Inherited_from
- \modObjectGetProcessor::$$path

string
$permission= ''''
''Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$permission
- Inherited_from
- \modObjectGetProcessor::$$permission

string
$primaryKeyField= ''id''
'id'Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$primaryKeyField
- Inherited_from
- \modObjectGetProcessor::$$primaryKeyField

array
$properties= 'array()'
The array of properties being passed to this processor
Inherited from: \modProcessor::$$properties\modObjectProcessor::$$properties\modObjectGetProcessor::$$propertiesarray()Details- Type
- array
- Inherited_from
- \modProcessor::$$properties
- Inherited_from
- \modObjectProcessor::$$properties
- Inherited_from
- \modObjectGetProcessor::$$properties
Methods

__construct(
\modX $modx, array $properties
=
array()
)
:
voidCreates a modProcessor object.
Inherited from: \modProcessor::__construct()\modObjectProcessor::__construct()\modObjectGetProcessor::__construct()| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX instance |
| $properties | array | An array of properties |

_decodeLiterals(
string $string
)
:
stringDecodes strings encoded by _encodeLiterals to restore JavaScript literals.
Inherited from: \modProcessor::_decodeLiterals()\modObjectProcessor::_decodeLiterals()\modObjectGetProcessor::_decodeLiterals()| Name | Type | Description |
|---|---|---|
| $string | string | The JSON-encoded string with encoded literals. |
| Type | Description |
|---|---|
| string | The JSON-encoded string with literals restored. |
- Access
- protected

_encodeLiterals(
mixed $value, integer | string $key
)
:
voidEncodes certain JavaScript literal strings for later decoding.
Inherited from: \modProcessor::_encodeLiterals()\modObjectProcessor::_encodeLiterals()\modObjectGetProcessor::_encodeLiterals()| Name | Type | Description |
|---|---|---|
| $value | mixed | &$value A reference to the value to be encoded if it is identified as a literal. |
| $key | integer | string | The array key corresponding to the value. |
- Access
- protected

addFieldError(
string $key, string $message
=
''
)
:
mixedAdd an error to the field
Inherited from: \modProcessor::addFieldError()\modObjectProcessor::addFieldError()\modObjectGetProcessor::addFieldError()| Name | Type | Description |
|---|---|---|
| $key | string | |
| $message | string |
| Type | Description |
|---|---|
| mixed |

beforeOutput(
)
:
voidUsed for adding custom data in derivative types
Inherited from: \modObjectGetProcessor::beforeOutput()
checkPermissions(
)
:
booleanReturn true here to allow access to this processor.
Inherited from: \modObjectProcessor::checkPermissions()\modObjectGetProcessor::checkPermissions()| Type | Description |
|---|---|
| boolean |

download(
)
:
mixedAttempt to download the exported file to the browser
| Type | Description |
|---|---|
| mixed |

failure(
string $msg
=
'', mixed $object
=
null
)
:
array | stringReturn a failure message from the processor.
Inherited from: \modProcessor::failure()\modObjectProcessor::failure()\modObjectGetProcessor::failure()| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\TheReturn the proper instance of the derived class. This can be used to override how MODX loads a processor class; for example, when handling derivative classes with class_key settings.
Inherited from: \modProcessor::getInstance()\modObjectProcessor::getInstance()\modObjectGetProcessor::getInstance()| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX object. |
| $className | string | The name of the class that is being requested. |
| $properties | array | An array of properties being run with the processor |
| Type | Description |
|---|---|
| \The | class specified by $className |
- Static

getLanguageTopics(
)
:
arrayLoad a collection of Language Topics for this processor.
Inherited from: \modObjectProcessor::getLanguageTopics()\modObjectGetProcessor::getLanguageTopics()Override this in your derivative class to provide the array of topics to load.
| Type | Description |
|---|---|
| array |

getProperties(
)
:
arrayGet an array of properties for this processor
Inherited from: \modProcessor::getProperties()\modObjectProcessor::getProperties()\modObjectGetProcessor::getProperties()| Type | Description |
|---|---|
| array |

getProperty(
string $k, mixed $default
=
null
)
:
mixedGet a specific property.
Inherited from: \modProcessor::getProperty()\modObjectProcessor::getProperty()\modObjectGetProcessor::getProperty()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $default | mixed |
| Type | Description |
|---|---|
| mixed |

hasErrors(
)
:
booleanReturn whether or not the processor has errors
Inherited from: \modProcessor::hasErrors()\modObjectProcessor::hasErrors()\modObjectGetProcessor::hasErrors()| Type | Description |
|---|---|
| boolean |

initialize(
)
:
booleanCan be used to provide custom methods prior to processing. Return true to tell MODX that the Processor initialized successfully. If you return anything else, MODX will output that return value as an error message.
Inherited from: \modObjectGetProcessor::initialize()| Type | Description |
|---|---|
| boolean |

outputArray(
array $array, mixed $count
=
false
)
:
stringReturn arrays of objects (with count) converted to JSON.
Inherited from: \modProcessor::outputArray()\modObjectProcessor::outputArray()\modObjectGetProcessor::outputArray()The JSON result includes two main elements, total and results. This format is used for list results.
| Name | Type | Description |
|---|---|---|
| $array | array | An array of data objects. |
| $count | mixed | The total number of objects. Used for pagination. |
| Type | Description |
|---|---|
| string | The JSON output. |
- Access
- public

prepareXml(
)
:
voidMust be declared in your derivative class. Used to prepare the data to export.
- Abstract

process(
)
:
mixedRun the processor and return the result. Override this in your derivative class to provide custom functionality.
Inherited from: \modObjectGetProcessor::process()Used here for pre-2.2-style processors.
| Type | Description |
|---|---|
| mixed |

processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
stringProcesses a response from a Plugin Event invocation
Inherited from: \modProcessor::processEventResponse()\modObjectProcessor::processEventResponse()\modObjectGetProcessor::processEventResponse()| Name | Type | Description |
|---|---|---|
| $response | array | string | The response generated by the invokeEvent call |
| $separator | string | The separator for each event response |
| Type | Description |
|---|---|
| string | The processed response. |

run(
)
:
\modProcessorResponseRun the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()\modObjectProcessor::run()\modObjectGetProcessor::run()| Type | Description |
|---|---|
| \modProcessorResponse |

setCheckbox(
string $k, boolean $force
=
false
)
:
int | nullSpecial helper method for handling checkboxes. Only set value if passed or $force is true, and check for a not empty value or string 'false'.
Inherited from: \modProcessor::setCheckbox()\modObjectProcessor::setCheckbox()\modObjectGetProcessor::setCheckbox()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $force | boolean |
| Type | Description |
|---|---|
| int | null |

setDefaultProperties(
array $properties
=
array()
)
:
arraySets default properties that only are set if they don't already exist in the request
Inherited from: \modProcessor::setDefaultProperties()\modObjectProcessor::setDefaultProperties()\modObjectGetProcessor::setDefaultProperties()| Name | Type | Description |
|---|---|---|
| $properties | array |
| Type | Description |
|---|---|
| array | The newly merged properties array |

setPath(
string $path
)
:
voidSet the path of the processor
Inherited from: \modProcessor::setPath()\modObjectProcessor::setPath()\modObjectGetProcessor::setPath()| Name | Type | Description |
|---|---|---|
| $path | string | The absolute path |

setProperties(
array $properties
)
:
voidSet the runtime properties for the processor
Inherited from: \modProcessor::setProperties()\modObjectProcessor::setProperties()\modObjectGetProcessor::setProperties()| Name | Type | Description |
|---|---|---|
| $properties | array | The properties, in array and key-value form, to run on this processor |

setProperty(
string $k, mixed $v
)
:
voidSet a property value
Inherited from: \modProcessor::setProperty()\modObjectProcessor::setProperty()\modObjectGetProcessor::setProperty()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $v | mixed |

success(
string $msg
=
'', mixed $object
=
null
)
:
array | stringReturn a success message from the processor.
Inherited from: \modProcessor::success()\modObjectProcessor::success()\modObjectGetProcessor::success()| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

toJSON(
mixed $data
)
:
stringConverts PHP to JSON with JavaScript literals left in-tact.
Inherited from: \modProcessor::toJSON()\modObjectProcessor::toJSON()\modObjectGetProcessor::toJSON()JSON does not allow JavaScript literals, but this function encodes certain identifiable literals and decodes them back into literals after modX::toJSON() formats the data.
| Name | Type | Description |
|---|---|---|
| $data | mixed | The PHP data to be converted. |
| Type | Description |
|---|---|
| string | The extended JSON-encoded string. |
- Access
- public

unsetProperty(
string $key
)
:
voidCompletely unset a property from the properties array
Inherited from: \modProcessor::unsetProperty()\modObjectProcessor::unsetProperty()\modObjectGetProcessor::unsetProperty()| Name | Type | Description |
|---|---|---|
| $key | string |
\modObjectGetListProcessor
A utility abstract class for defining getlist-based processors
{@inheritdoc}
- Parent(s)
- \modObjectProcessor < \modProcessor
- Children
- \modResourceGetListProcessor
- \modResourceSearchProcessor
- \modUserUserGroupGetListProcessor
- \modUserGetListProcessor
- \modUserMessageGetListProcessor
- \modAccessPermissionGetListProcessor
- \modAccessPolicyTemplateGroupGetListProcessor
- \modAccessPolicyTemplateGetListProcessor
- \modAccessPolicyGetListProcessor
- \modResourceGroupGetListProcessor
- \modUserGroupUserGetListProcessor
- \modUserGroupGetListProcessor
- \modFormCustomizationSetGetListProcessor
- \modFormCustomizationProfileGetListProcessor
- \modUserGroupRoleGetListProcessor
- \modSystemSettingsGetListProcessor
- \modContentTypeGetListProcessor
- \modActiveResourceListProcessor
- \modActionGetListProcessor
- \modDashboardWidgetGetListProcessor
- \modDashboardGetListProcessor
- \modClassMapGetListProcessor
- \modContextGetListProcessor
- \modMediaSourceGetListProcessor
- \modNamespaceGetListProcessor
- \modProviderGetListProcessor
- \modPackageGetListProcessor
- \modPackageVersionGetListProcessor
- \modElementGetListProcessor
- \modElementCategoryGetListProcessor
- Abstract
Properties

boolean
$checkListPermission= 'true'
trueDetails- Type
- boolean

string
$classKey= ''
- Type
- string
- Inherited_from
- \modObjectProcessor::$$classKey

string
$defaultSortDirection= ''ASC''
'ASC'Details- Type
- string

string
$defaultSortField= ''name''
'name'Details- Type
- string

array
$languageTopics= 'array()'
array()Details- Type
- array
- Inherited_from
- \modObjectProcessor::$$languageTopics

\modX
$modx= 'null'
A reference to the modX object.
Inherited from: \modProcessor::$$modx\modObjectProcessor::$$modxnullDetails- Type
- \modX
- Inherited_from
- \modProcessor::$$modx
- Inherited_from
- \modObjectProcessor::$$modx

\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject
- Inherited_from
- \modObjectProcessor::$$object

string
$objectType= ''object''
'object'Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$objectType

string
$path= ''''
The absolute path to this processor
Inherited from: \modProcessor::$$path\modObjectProcessor::$$path''Details- Type
- string
- Inherited_from
- \modProcessor::$$path
- Inherited_from
- \modObjectProcessor::$$path

string
$permission= ''''
''Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$permission

string
$primaryKeyField= ''id''
'id'Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$primaryKeyField

array
$properties= 'array()'
The array of properties being passed to this processor
Inherited from: \modProcessor::$$properties\modObjectProcessor::$$propertiesarray()Details- Type
- array
- Inherited_from
- \modProcessor::$$properties
- Inherited_from
- \modObjectProcessor::$$properties
Methods

__construct(
\modX $modx, array $properties
=
array()
)
:
voidCreates a modProcessor object.
Inherited from: \modProcessor::__construct()\modObjectProcessor::__construct()| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX instance |
| $properties | array | An array of properties |

_decodeLiterals(
string $string
)
:
stringDecodes strings encoded by _encodeLiterals to restore JavaScript literals.
Inherited from: \modProcessor::_decodeLiterals()\modObjectProcessor::_decodeLiterals()| Name | Type | Description |
|---|---|---|
| $string | string | The JSON-encoded string with encoded literals. |
| Type | Description |
|---|---|
| string | The JSON-encoded string with literals restored. |
- Access
- protected

_encodeLiterals(
mixed $value, integer | string $key
)
:
voidEncodes certain JavaScript literal strings for later decoding.
Inherited from: \modProcessor::_encodeLiterals()\modObjectProcessor::_encodeLiterals()| Name | Type | Description |
|---|---|---|
| $value | mixed | &$value A reference to the value to be encoded if it is identified as a literal. |
| $key | integer | string | The array key corresponding to the value. |
- Access
- protected

addFieldError(
string $key, string $message
=
''
)
:
mixedAdd an error to the field
Inherited from: \modProcessor::addFieldError()\modObjectProcessor::addFieldError()| Name | Type | Description |
|---|---|---|
| $key | string | |
| $message | string |
| Type | Description |
|---|---|
| mixed |

afterIteration(
array $list
)
:
arrayCan be used to insert a row after iteration
| Name | Type | Description |
|---|---|---|
| $list | array |
| Type | Description |
|---|---|
| array |

beforeIteration(
array $list
)
:
arrayCan be used to insert a row before iteration
| Name | Type | Description |
|---|---|---|
| $list | array |
| Type | Description |
|---|---|
| array |

checkPermissions(
)
:
booleanReturn true here to allow access to this processor.
Inherited from: \modObjectProcessor::checkPermissions()| Type | Description |
|---|---|
| boolean |

failure(
string $msg
=
'', mixed $object
=
null
)
:
array | stringReturn a failure message from the processor.
Inherited from: \modProcessor::failure()\modObjectProcessor::failure()| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\TheReturn the proper instance of the derived class. This can be used to override how MODX loads a processor class; for example, when handling derivative classes with class_key settings.
Inherited from: \modProcessor::getInstance()\modObjectProcessor::getInstance()| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX object. |
| $className | string | The name of the class that is being requested. |
| $properties | array | An array of properties being run with the processor |
| Type | Description |
|---|---|
| \The | class specified by $className |
- Static

getLanguageTopics(
)
:
arrayLoad a collection of Language Topics for this processor.
Inherited from: \modObjectProcessor::getLanguageTopics()Override this in your derivative class to provide the array of topics to load.
| Type | Description |
|---|---|
| array |

getProperties(
)
:
arrayGet an array of properties for this processor
Inherited from: \modProcessor::getProperties()\modObjectProcessor::getProperties()| Type | Description |
|---|---|
| array |

getProperty(
string $k, mixed $default
=
null
)
:
mixedGet a specific property.
Inherited from: \modProcessor::getProperty()\modObjectProcessor::getProperty()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $default | mixed |
| Type | Description |
|---|---|
| mixed |

getSortClassKey(
)
:
stringCan be used to provide a custom sorting class key for the default sorting columns
| Type | Description |
|---|---|
| string |

hasErrors(
)
:
booleanReturn whether or not the processor has errors
Inherited from: \modProcessor::hasErrors()\modObjectProcessor::hasErrors()| Type | Description |
|---|---|
| boolean |

initialize(
)
:
booleanCan be used to provide custom methods prior to processing. Return true to tell MODX that the Processor initialized successfully. If you return anything else, MODX will output that return value as an error message.
| Type | Description |
|---|---|
| boolean |

iterate(
array $data
)
:
arrayIterate across the data
| Name | Type | Description |
|---|---|---|
| $data | array |
| Type | Description |
|---|---|
| array |

outputArray(
array $array, mixed $count
=
false
)
:
stringReturn arrays of objects (with count) converted to JSON.
Inherited from: \modProcessor::outputArray()\modObjectProcessor::outputArray()The JSON result includes two main elements, total and results. This format is used for list results.
| Name | Type | Description |
|---|---|---|
| $array | array | An array of data objects. |
| $count | mixed | The total number of objects. Used for pagination. |
| Type | Description |
|---|---|
| string | The JSON output. |
- Access
- public

prepareQueryAfterCount(
\xPDOQuery $c
)
:
\xPDOQueryCan be used to prepare the query after the COUNT statement
| Name | Type | Description |
|---|---|---|
| $c | \xPDOQuery |
| Type | Description |
|---|---|
| \xPDOQuery |

prepareQueryBeforeCount(
\xPDOQuery $c
)
:
\xPDOQueryCan be used to adjust the query prior to the COUNT statement
| Name | Type | Description |
|---|---|---|
| $c | \xPDOQuery |
| Type | Description |
|---|---|
| \xPDOQuery |

prepareRow(
\xPDOObject $object
)
:
arrayPrepare the row for iteration
| Name | Type | Description |
|---|---|---|
| $object | \xPDOObject |
| Type | Description |
|---|---|
| array |

process(
)
:
mixedRun the processor and return the result. Override this in your derivative class to provide custom functionality.
Used here for pre-2.2-style processors.
| Type | Description |
|---|---|
| mixed |

processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
stringProcesses a response from a Plugin Event invocation
Inherited from: \modProcessor::processEventResponse()\modObjectProcessor::processEventResponse()| Name | Type | Description |
|---|---|---|
| $response | array | string | The response generated by the invokeEvent call |
| $separator | string | The separator for each event response |
| Type | Description |
|---|---|
| string | The processed response. |

run(
)
:
\modProcessorResponseRun the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()\modObjectProcessor::run()| Type | Description |
|---|---|
| \modProcessorResponse |

setCheckbox(
string $k, boolean $force
=
false
)
:
int | nullSpecial helper method for handling checkboxes. Only set value if passed or $force is true, and check for a not empty value or string 'false'.
Inherited from: \modProcessor::setCheckbox()\modObjectProcessor::setCheckbox()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $force | boolean |
| Type | Description |
|---|---|
| int | null |

setDefaultProperties(
array $properties
=
array()
)
:
arraySets default properties that only are set if they don't already exist in the request
Inherited from: \modProcessor::setDefaultProperties()\modObjectProcessor::setDefaultProperties()| Name | Type | Description |
|---|---|---|
| $properties | array |
| Type | Description |
|---|---|
| array | The newly merged properties array |

setPath(
string $path
)
:
voidSet the path of the processor
Inherited from: \modProcessor::setPath()\modObjectProcessor::setPath()| Name | Type | Description |
|---|---|---|
| $path | string | The absolute path |

setProperties(
array $properties
)
:
voidSet the runtime properties for the processor
Inherited from: \modProcessor::setProperties()\modObjectProcessor::setProperties()| Name | Type | Description |
|---|---|---|
| $properties | array | The properties, in array and key-value form, to run on this processor |

setProperty(
string $k, mixed $v
)
:
voidSet a property value
Inherited from: \modProcessor::setProperty()\modObjectProcessor::setProperty()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $v | mixed |

success(
string $msg
=
'', mixed $object
=
null
)
:
array | stringReturn a success message from the processor.
Inherited from: \modProcessor::success()\modObjectProcessor::success()| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

toJSON(
mixed $data
)
:
stringConverts PHP to JSON with JavaScript literals left in-tact.
Inherited from: \modProcessor::toJSON()\modObjectProcessor::toJSON()JSON does not allow JavaScript literals, but this function encodes certain identifiable literals and decodes them back into literals after modX::toJSON() formats the data.
| Name | Type | Description |
|---|---|---|
| $data | mixed | The PHP data to be converted. |
| Type | Description |
|---|---|
| string | The extended JSON-encoded string. |
- Access
- public

unsetProperty(
string $key
)
:
voidCompletely unset a property from the properties array
Inherited from: \modProcessor::unsetProperty()\modObjectProcessor::unsetProperty()| Name | Type | Description |
|---|---|---|
| $key | string |
\modObjectGetProcessor
A utility abstract class for defining get-based processors
{@inheritdoc}
- Parent(s)
- \modObjectProcessor < \modProcessor
- Children
- \modObjectExportProcessor
- \modResourceGetProcessor
- \modUserGetProcessor
- \modUserGroupRoleGetProcessor
- \modActionGetProcessor
- \modContextGetProcessor
- \modPackageGetProcessor
- \modElementCategoryGetProcessor
- \modElementGetProcessor
- Abstract
Properties

boolean
$checkViewPermission= 'true'
trueDetails- Type
- boolean

string
$classKey= ''
- Type
- string
- Inherited_from
- \modObjectProcessor::$$classKey

array
$languageTopics= 'array()'
array()Details- Type
- array
- Inherited_from
- \modObjectProcessor::$$languageTopics

\modX
$modx= 'null'
A reference to the modX object.
Inherited from: \modProcessor::$$modx\modObjectProcessor::$$modxnullDetails- Type
- \modX
- Inherited_from
- \modProcessor::$$modx
- Inherited_from
- \modObjectProcessor::$$modx

\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject
- Inherited_from
- \modObjectProcessor::$$object

string
$objectType= ''object''
'object'Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$objectType

string
$path= ''''
The absolute path to this processor
Inherited from: \modProcessor::$$path\modObjectProcessor::$$path''Details- Type
- string
- Inherited_from
- \modProcessor::$$path
- Inherited_from
- \modObjectProcessor::$$path

string
$permission= ''''
''Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$permission

string
$primaryKeyField= ''id''
'id'Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$primaryKeyField

array
$properties= 'array()'
The array of properties being passed to this processor
Inherited from: \modProcessor::$$properties\modObjectProcessor::$$propertiesarray()Details- Type
- array
- Inherited_from
- \modProcessor::$$properties
- Inherited_from
- \modObjectProcessor::$$properties
Methods

__construct(
\modX $modx, array $properties
=
array()
)
:
voidCreates a modProcessor object.
Inherited from: \modProcessor::__construct()\modObjectProcessor::__construct()| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX instance |
| $properties | array | An array of properties |

_decodeLiterals(
string $string
)
:
stringDecodes strings encoded by _encodeLiterals to restore JavaScript literals.
Inherited from: \modProcessor::_decodeLiterals()\modObjectProcessor::_decodeLiterals()| Name | Type | Description |
|---|---|---|
| $string | string | The JSON-encoded string with encoded literals. |
| Type | Description |
|---|---|
| string | The JSON-encoded string with literals restored. |
- Access
- protected

_encodeLiterals(
mixed $value, integer | string $key
)
:
voidEncodes certain JavaScript literal strings for later decoding.
Inherited from: \modProcessor::_encodeLiterals()\modObjectProcessor::_encodeLiterals()| Name | Type | Description |
|---|---|---|
| $value | mixed | &$value A reference to the value to be encoded if it is identified as a literal. |
| $key | integer | string | The array key corresponding to the value. |
- Access
- protected

addFieldError(
string $key, string $message
=
''
)
:
mixedAdd an error to the field
Inherited from: \modProcessor::addFieldError()\modObjectProcessor::addFieldError()| Name | Type | Description |
|---|---|---|
| $key | string | |
| $message | string |
| Type | Description |
|---|---|
| mixed |

checkPermissions(
)
:
booleanReturn true here to allow access to this processor.
Inherited from: \modObjectProcessor::checkPermissions()| Type | Description |
|---|---|
| boolean |

failure(
string $msg
=
'', mixed $object
=
null
)
:
array | stringReturn a failure message from the processor.
Inherited from: \modProcessor::failure()\modObjectProcessor::failure()| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\TheReturn the proper instance of the derived class. This can be used to override how MODX loads a processor class; for example, when handling derivative classes with class_key settings.
Inherited from: \modProcessor::getInstance()\modObjectProcessor::getInstance()| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX object. |
| $className | string | The name of the class that is being requested. |
| $properties | array | An array of properties being run with the processor |
| Type | Description |
|---|---|
| \The | class specified by $className |
- Static

getLanguageTopics(
)
:
arrayLoad a collection of Language Topics for this processor.
Inherited from: \modObjectProcessor::getLanguageTopics()Override this in your derivative class to provide the array of topics to load.
| Type | Description |
|---|---|
| array |

getProperties(
)
:
arrayGet an array of properties for this processor
Inherited from: \modProcessor::getProperties()\modObjectProcessor::getProperties()| Type | Description |
|---|---|
| array |

getProperty(
string $k, mixed $default
=
null
)
:
mixedGet a specific property.
Inherited from: \modProcessor::getProperty()\modObjectProcessor::getProperty()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $default | mixed |
| Type | Description |
|---|---|
| mixed |

hasErrors(
)
:
booleanReturn whether or not the processor has errors
Inherited from: \modProcessor::hasErrors()\modObjectProcessor::hasErrors()| Type | Description |
|---|---|
| boolean |

initialize(
)
:
booleanCan be used to provide custom methods prior to processing. Return true to tell MODX that the Processor initialized successfully. If you return anything else, MODX will output that return value as an error message.
| Type | Description |
|---|---|
| boolean |

outputArray(
array $array, mixed $count
=
false
)
:
stringReturn arrays of objects (with count) converted to JSON.
Inherited from: \modProcessor::outputArray()\modObjectProcessor::outputArray()The JSON result includes two main elements, total and results. This format is used for list results.
| Name | Type | Description |
|---|---|---|
| $array | array | An array of data objects. |
| $count | mixed | The total number of objects. Used for pagination. |
| Type | Description |
|---|---|
| string | The JSON output. |
- Access
- public

process(
)
:
mixedRun the processor and return the result. Override this in your derivative class to provide custom functionality.
Used here for pre-2.2-style processors.
| Type | Description |
|---|---|
| mixed |

processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
stringProcesses a response from a Plugin Event invocation
Inherited from: \modProcessor::processEventResponse()\modObjectProcessor::processEventResponse()| Name | Type | Description |
|---|---|---|
| $response | array | string | The response generated by the invokeEvent call |
| $separator | string | The separator for each event response |
| Type | Description |
|---|---|
| string | The processed response. |

run(
)
:
\modProcessorResponseRun the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()\modObjectProcessor::run()| Type | Description |
|---|---|
| \modProcessorResponse |

setCheckbox(
string $k, boolean $force
=
false
)
:
int | nullSpecial helper method for handling checkboxes. Only set value if passed or $force is true, and check for a not empty value or string 'false'.
Inherited from: \modProcessor::setCheckbox()\modObjectProcessor::setCheckbox()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $force | boolean |
| Type | Description |
|---|---|
| int | null |

setDefaultProperties(
array $properties
=
array()
)
:
arraySets default properties that only are set if they don't already exist in the request
Inherited from: \modProcessor::setDefaultProperties()\modObjectProcessor::setDefaultProperties()| Name | Type | Description |
|---|---|---|
| $properties | array |
| Type | Description |
|---|---|
| array | The newly merged properties array |

setPath(
string $path
)
:
voidSet the path of the processor
Inherited from: \modProcessor::setPath()\modObjectProcessor::setPath()| Name | Type | Description |
|---|---|---|
| $path | string | The absolute path |

setProperties(
array $properties
)
:
voidSet the runtime properties for the processor
Inherited from: \modProcessor::setProperties()\modObjectProcessor::setProperties()| Name | Type | Description |
|---|---|---|
| $properties | array | The properties, in array and key-value form, to run on this processor |

setProperty(
string $k, mixed $v
)
:
voidSet a property value
Inherited from: \modProcessor::setProperty()\modObjectProcessor::setProperty()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $v | mixed |

success(
string $msg
=
'', mixed $object
=
null
)
:
array | stringReturn a success message from the processor.
Inherited from: \modProcessor::success()\modObjectProcessor::success()| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

toJSON(
mixed $data
)
:
stringConverts PHP to JSON with JavaScript literals left in-tact.
Inherited from: \modProcessor::toJSON()\modObjectProcessor::toJSON()JSON does not allow JavaScript literals, but this function encodes certain identifiable literals and decodes them back into literals after modX::toJSON() formats the data.
| Name | Type | Description |
|---|---|---|
| $data | mixed | The PHP data to be converted. |
| Type | Description |
|---|---|
| string | The extended JSON-encoded string. |
- Access
- public

unsetProperty(
string $key
)
:
voidCompletely unset a property from the properties array
Inherited from: \modProcessor::unsetProperty()\modObjectProcessor::unsetProperty()| Name | Type | Description |
|---|---|---|
| $key | string |
\modObjectImportProcessor
Utility class for importing an object
{@inheritdoc}
- Parent(s)
- \modObjectProcessor < \modProcessor
- Children
- \modAccessPolicyImportProcessor
- \modAccessPolicyTemplateImportProcessor
- Abstract
Properties

string
$classKey= ''
- Type
- string
- Inherited_from
- \modObjectProcessor::$$classKey

string
$fileProperty= ''file''
'file'Details- Type
- string

array
$languageTopics= 'array()'
array()Details- Type
- array
- Inherited_from
- \modObjectProcessor::$$languageTopics

\modX
$modx= 'null'
A reference to the modX object.
Inherited from: \modProcessor::$$modx\modObjectProcessor::$$modxnullDetails- Type
- \modX
- Inherited_from
- \modProcessor::$$modx
- Inherited_from
- \modObjectProcessor::$$modx

string
$nameField= ''name''
'name'Details- Type
- string

\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject
- Inherited_from
- \modObjectProcessor::$$object

string
$objectType= ''object''
'object'Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$objectType

string
$path= ''''
The absolute path to this processor
Inherited from: \modProcessor::$$path\modObjectProcessor::$$path''Details- Type
- string
- Inherited_from
- \modProcessor::$$path
- Inherited_from
- \modObjectProcessor::$$path

string
$permission= ''''
''Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$permission

string
$primaryKeyField= ''id''
'id'Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$primaryKeyField

array
$properties= 'array()'
The array of properties being passed to this processor
Inherited from: \modProcessor::$$properties\modObjectProcessor::$$propertiesarray()Details- Type
- array
- Inherited_from
- \modProcessor::$$properties
- Inherited_from
- \modObjectProcessor::$$properties

boolean
$setName= 'true'
trueDetails- Type
- boolean
Methods

__construct(
\modX $modx, array $properties
=
array()
)
:
voidCreates a modProcessor object.
Inherited from: \modProcessor::__construct()\modObjectProcessor::__construct()| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX instance |
| $properties | array | An array of properties |

_decodeLiterals(
string $string
)
:
stringDecodes strings encoded by _encodeLiterals to restore JavaScript literals.
Inherited from: \modProcessor::_decodeLiterals()\modObjectProcessor::_decodeLiterals()| Name | Type | Description |
|---|---|---|
| $string | string | The JSON-encoded string with encoded literals. |
| Type | Description |
|---|---|
| string | The JSON-encoded string with literals restored. |
- Access
- protected

_encodeLiterals(
mixed $value, integer | string $key
)
:
voidEncodes certain JavaScript literal strings for later decoding.
Inherited from: \modProcessor::_encodeLiterals()\modObjectProcessor::_encodeLiterals()| Name | Type | Description |
|---|---|---|
| $value | mixed | &$value A reference to the value to be encoded if it is identified as a literal. |
| $key | integer | string | The array key corresponding to the value. |
- Access
- protected

addFieldError(
string $key, string $message
=
''
)
:
mixedAdd an error to the field
Inherited from: \modProcessor::addFieldError()\modObjectProcessor::addFieldError()| Name | Type | Description |
|---|---|---|
| $key | string | |
| $message | string |
| Type | Description |
|---|---|
| mixed |

alreadyExists(
string $name
)
:
boolCheck to see if the object already exists with this name field
| Name | Type | Description |
|---|---|---|
| $name | string |
| Type | Description |
|---|---|
| bool |

checkPermissions(
)
:
booleanReturn true here to allow access to this processor.
Inherited from: \modObjectProcessor::checkPermissions()| Type | Description |
|---|---|
| boolean |

failure(
string $msg
=
'', mixed $object
=
null
)
:
array | stringReturn a failure message from the processor.
Inherited from: \modProcessor::failure()\modObjectProcessor::failure()| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\TheReturn the proper instance of the derived class. This can be used to override how MODX loads a processor class; for example, when handling derivative classes with class_key settings.
Inherited from: \modProcessor::getInstance()\modObjectProcessor::getInstance()| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX object. |
| $className | string | The name of the class that is being requested. |
| $properties | array | An array of properties being run with the processor |
| Type | Description |
|---|---|
| \The | class specified by $className |
- Static

getLanguageTopics(
)
:
arrayLoad a collection of Language Topics for this processor.
Inherited from: \modObjectProcessor::getLanguageTopics()Override this in your derivative class to provide the array of topics to load.
| Type | Description |
|---|---|
| array |

getProperties(
)
:
arrayGet an array of properties for this processor
Inherited from: \modProcessor::getProperties()\modObjectProcessor::getProperties()| Type | Description |
|---|---|
| array |

getProperty(
string $k, mixed $default
=
null
)
:
mixedGet a specific property.
Inherited from: \modProcessor::getProperty()\modObjectProcessor::getProperty()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $default | mixed |
| Type | Description |
|---|---|
| mixed |

hasErrors(
)
:
booleanReturn whether or not the processor has errors
Inherited from: \modProcessor::hasErrors()\modObjectProcessor::hasErrors()| Type | Description |
|---|---|
| boolean |

initialize(
)
:
booleanCan be used to provide custom methods prior to processing. Return true to tell MODX that the Processor initialized successfully. If you return anything else, MODX will output that return value as an error message.
| Type | Description |
|---|---|
| boolean |

outputArray(
array $array, mixed $count
=
false
)
:
stringReturn arrays of objects (with count) converted to JSON.
Inherited from: \modProcessor::outputArray()\modObjectProcessor::outputArray()The JSON result includes two main elements, total and results. This format is used for list results.
| Name | Type | Description |
|---|---|---|
| $array | array | An array of data objects. |
| $count | mixed | The total number of objects. Used for pagination. |
| Type | Description |
|---|---|
| string | The JSON output. |
- Access
- public

process(
)
:
mixedRun the processor and return the result. Override this in your derivative class to provide custom functionality.
Used here for pre-2.2-style processors.
| Type | Description |
|---|---|
| mixed |

processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
stringProcesses a response from a Plugin Event invocation
Inherited from: \modProcessor::processEventResponse()\modObjectProcessor::processEventResponse()| Name | Type | Description |
|---|---|---|
| $response | array | string | The response generated by the invokeEvent call |
| $separator | string | The separator for each event response |
| Type | Description |
|---|---|
| string | The processed response. |

run(
)
:
\modProcessorResponseRun the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()\modObjectProcessor::run()| Type | Description |
|---|---|
| \modProcessorResponse |

setCheckbox(
string $k, boolean $force
=
false
)
:
int | nullSpecial helper method for handling checkboxes. Only set value if passed or $force is true, and check for a not empty value or string 'false'.
Inherited from: \modProcessor::setCheckbox()\modObjectProcessor::setCheckbox()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $force | boolean |
| Type | Description |
|---|---|
| int | null |

setDefaultProperties(
array $properties
=
array()
)
:
arraySets default properties that only are set if they don't already exist in the request
Inherited from: \modProcessor::setDefaultProperties()\modObjectProcessor::setDefaultProperties()| Name | Type | Description |
|---|---|---|
| $properties | array |
| Type | Description |
|---|---|
| array | The newly merged properties array |

setPath(
string $path
)
:
voidSet the path of the processor
Inherited from: \modProcessor::setPath()\modObjectProcessor::setPath()| Name | Type | Description |
|---|---|---|
| $path | string | The absolute path |

setProperties(
array $properties
)
:
voidSet the runtime properties for the processor
Inherited from: \modProcessor::setProperties()\modObjectProcessor::setProperties()| Name | Type | Description |
|---|---|---|
| $properties | array | The properties, in array and key-value form, to run on this processor |

setProperty(
string $k, mixed $v
)
:
voidSet a property value
Inherited from: \modProcessor::setProperty()\modObjectProcessor::setProperty()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $v | mixed |

success(
string $msg
=
'', mixed $object
=
null
)
:
array | stringReturn a success message from the processor.
Inherited from: \modProcessor::success()\modObjectProcessor::success()| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

toJSON(
mixed $data
)
:
stringConverts PHP to JSON with JavaScript literals left in-tact.
Inherited from: \modProcessor::toJSON()\modObjectProcessor::toJSON()JSON does not allow JavaScript literals, but this function encodes certain identifiable literals and decodes them back into literals after modX::toJSON() formats the data.
| Name | Type | Description |
|---|---|---|
| $data | mixed | The PHP data to be converted. |
| Type | Description |
|---|---|
| string | The extended JSON-encoded string. |
- Access
- public

unsetProperty(
string $key
)
:
voidCompletely unset a property from the properties array
Inherited from: \modProcessor::unsetProperty()\modObjectProcessor::unsetProperty()| Name | Type | Description |
|---|---|---|
| $key | string |
\modObjectProcessor
Base class for object-specific processors
{@inheritdoc}
- Parent(s)
- \modProcessor
- Children
- \modObjectGetProcessor
- \modObjectGetListProcessor
- \modObjectCreateProcessor
- \modObjectUpdateProcessor
- \modObjectDuplicateProcessor
- \modObjectRemoveProcessor
- \modObjectImportProcessor
- \modAccessPolicyRemoveMultipleProcessor
- \modAccessPolicyTemplateRemoveMultipleProcessor
- \modPluginEventGetListProcessor
- Abstract
Properties

array
$languageTopics= 'array()'
array()Details- Type
- array

\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject

string
$objectType= ''object''
'object'Details- Type
- string

string
$permission= ''''
''Details- Type
- string

string
$primaryKeyField= ''id''
'id'Details- Type
- string

array
$properties= 'array()'
The array of properties being passed to this processor
Inherited from: \modProcessor::$$propertiesarray()Details- Type
- array
- Inherited_from
- \modProcessor::$$properties
Methods

__construct(
\modX $modx, array $properties
=
array()
)
:
void
| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX instance |
| $properties | array | An array of properties |

_decodeLiterals(
string $string
)
:
stringDecodes strings encoded by _encodeLiterals to restore JavaScript literals.
Inherited from: \modProcessor::_decodeLiterals()| Name | Type | Description |
|---|---|---|
| $string | string | The JSON-encoded string with encoded literals. |
| Type | Description |
|---|---|
| string | The JSON-encoded string with literals restored. |
- Access
- protected

_encodeLiterals(
mixed $value, integer | string $key
)
:
voidEncodes certain JavaScript literal strings for later decoding.
Inherited from: \modProcessor::_encodeLiterals()| Name | Type | Description |
|---|---|---|
| $value | mixed | &$value A reference to the value to be encoded if it is identified as a literal. |
| $key | integer | string | The array key corresponding to the value. |
- Access
- protected

addFieldError(
string $key, string $message
=
''
)
:
mixed
| Name | Type | Description |
|---|---|---|
| $key | string | |
| $message | string |
| Type | Description |
|---|---|
| mixed |

checkPermissions(
)
:
booleanReturn true here to allow access to this processor.
| Type | Description |
|---|---|
| boolean |

failure(
string $msg
=
'', mixed $object
=
null
)
:
array | string
| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\TheReturn the proper instance of the derived class. This can be used to override how MODX loads a processor class; for example, when handling derivative classes with class_key settings.
Inherited from: \modProcessor::getInstance()| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX object. |
| $className | string | The name of the class that is being requested. |
| $properties | array | An array of properties being run with the processor |
| Type | Description |
|---|---|
| \The | class specified by $className |
- Static

getLanguageTopics(
)
:
arrayLoad a collection of Language Topics for this processor.
Override this in your derivative class to provide the array of topics to load.
| Type | Description |
|---|---|
| array |

getProperties(
)
:
arrayGet an array of properties for this processor
Inherited from: \modProcessor::getProperties()| Type | Description |
|---|---|
| array |

getProperty(
string $k, mixed $default
=
null
)
:
mixed
| Name | Type | Description |
|---|---|---|
| $k | string | |
| $default | mixed |
| Type | Description |
|---|---|
| mixed |

initialize(
)
:
booleanCan be used to provide custom methods prior to processing. Return true to tell MODX that the Processor initialized successfully. If you return anything else, MODX will output that return value as an error message.
Inherited from: \modProcessor::initialize()| Type | Description |
|---|---|
| boolean |

outputArray(
array $array, mixed $count
=
false
)
:
stringReturn arrays of objects (with count) converted to JSON.
Inherited from: \modProcessor::outputArray()The JSON result includes two main elements, total and results. This format is used for list results.
| Name | Type | Description |
|---|---|---|
| $array | array | An array of data objects. |
| $count | mixed | The total number of objects. Used for pagination. |
| Type | Description |
|---|---|
| string | The JSON output. |
- Access
- public

process(
)
:
mixedRun the processor and return the result. Override this in your derivative class to provide custom functionality.
Inherited from: \modProcessor::process()Used here for pre-2.2-style processors.
| Type | Description |
|---|---|
| mixed |

processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
stringProcesses a response from a Plugin Event invocation
Inherited from: \modProcessor::processEventResponse()| Name | Type | Description |
|---|---|---|
| $response | array | string | The response generated by the invokeEvent call |
| $separator | string | The separator for each event response |
| Type | Description |
|---|---|
| string | The processed response. |

run(
)
:
\modProcessorResponseRun the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()| Type | Description |
|---|---|
| \modProcessorResponse |

setCheckbox(
string $k, boolean $force
=
false
)
:
int | nullSpecial helper method for handling checkboxes. Only set value if passed or $force is true, and check for a not empty value or string 'false'.
Inherited from: \modProcessor::setCheckbox()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $force | boolean |
| Type | Description |
|---|---|
| int | null |

setDefaultProperties(
array $properties
=
array()
)
:
arraySets default properties that only are set if they don't already exist in the request
Inherited from: \modProcessor::setDefaultProperties()| Name | Type | Description |
|---|---|---|
| $properties | array |
| Type | Description |
|---|---|
| array | The newly merged properties array |

setProperties(
array $properties
)
:
voidSet the runtime properties for the processor
Inherited from: \modProcessor::setProperties()| Name | Type | Description |
|---|---|---|
| $properties | array | The properties, in array and key-value form, to run on this processor |

success(
string $msg
=
'', mixed $object
=
null
)
:
array | string
| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

toJSON(
mixed $data
)
:
stringConverts PHP to JSON with JavaScript literals left in-tact.
Inherited from: \modProcessor::toJSON()JSON does not allow JavaScript literals, but this function encodes certain identifiable literals and decodes them back into literals after modX::toJSON() formats the data.
| Name | Type | Description |
|---|---|---|
| $data | mixed | The PHP data to be converted. |
| Type | Description |
|---|---|
| string | The extended JSON-encoded string. |
- Access
- public

unsetProperty(
string $key
)
:
voidCompletely unset a property from the properties array
Inherited from: \modProcessor::unsetProperty()| Name | Type | Description |
|---|---|---|
| $key | string |
\modObjectRemoveProcessor
A utility abstract class for defining remove-based processors
{@inheritdoc}
- Parent(s)
- \modObjectProcessor < \modProcessor
- Children
- \modUserDeleteProcessor
- \modAccessPolicyRemoveProcessor
- \modAccessPolicyTemplateRemoveProcessor
- \modUserGroupRemoveProcessor
- \modFormCustomizationSetRemoveProcessor
- \modFormCustomizationProfileRemoveProcessor
- \modUserGroupRoleRemoveProcessor
- \modSystemSettingsRemoveProcessor
- \modContentTypeRemoveProcessor
- \modActionRemoveProcessor
- \modDashboardRemoveProcessor
- \modDashboardWidgetRemoveProcessor
- \modContextRemoveProcessor
- \modSourceRemoveProcessor
- \modNamespaceRemoveProcessor
- \modProviderRemoveProcessor
- \modElementRemoveProcessor
- \modElementCategoryRemoveProcessor
- Abstract
Properties

string
$afterRemoveEvent= ''''
''Details- Type
- string

string
$beforeRemoveEvent= ''''
''Details- Type
- string

boolean
$checkRemovePermission= 'true'
trueDetails- Type
- boolean

string
$classKey= ''
- Type
- string
- Inherited_from
- \modObjectProcessor::$$classKey

array
$languageTopics= 'array()'
array()Details- Type
- array
- Inherited_from
- \modObjectProcessor::$$languageTopics

\modX
$modx= 'null'
A reference to the modX object.
Inherited from: \modProcessor::$$modx\modObjectProcessor::$$modxnullDetails- Type
- \modX
- Inherited_from
- \modProcessor::$$modx
- Inherited_from
- \modObjectProcessor::$$modx

\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject
- Inherited_from
- \modObjectProcessor::$$object

string
$objectType= ''object''
'object'Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$objectType

string
$path= ''''
The absolute path to this processor
Inherited from: \modProcessor::$$path\modObjectProcessor::$$path''Details- Type
- string
- Inherited_from
- \modProcessor::$$path
- Inherited_from
- \modObjectProcessor::$$path

string
$permission= ''''
''Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$permission

string
$primaryKeyField= ''id''
'id'Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$primaryKeyField

array
$properties= 'array()'
The array of properties being passed to this processor
Inherited from: \modProcessor::$$properties\modObjectProcessor::$$propertiesarray()Details- Type
- array
- Inherited_from
- \modProcessor::$$properties
- Inherited_from
- \modObjectProcessor::$$properties
Methods

__construct(
\modX $modx, array $properties
=
array()
)
:
voidCreates a modProcessor object.
Inherited from: \modProcessor::__construct()\modObjectProcessor::__construct()| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX instance |
| $properties | array | An array of properties |

_decodeLiterals(
string $string
)
:
stringDecodes strings encoded by _encodeLiterals to restore JavaScript literals.
Inherited from: \modProcessor::_decodeLiterals()\modObjectProcessor::_decodeLiterals()| Name | Type | Description |
|---|---|---|
| $string | string | The JSON-encoded string with encoded literals. |
| Type | Description |
|---|---|
| string | The JSON-encoded string with literals restored. |
- Access
- protected

_encodeLiterals(
mixed $value, integer | string $key
)
:
voidEncodes certain JavaScript literal strings for later decoding.
Inherited from: \modProcessor::_encodeLiterals()\modObjectProcessor::_encodeLiterals()| Name | Type | Description |
|---|---|---|
| $value | mixed | &$value A reference to the value to be encoded if it is identified as a literal. |
| $key | integer | string | The array key corresponding to the value. |
- Access
- protected

addFieldError(
string $key, string $message
=
''
)
:
mixedAdd an error to the field
Inherited from: \modProcessor::addFieldError()\modObjectProcessor::addFieldError()| Name | Type | Description |
|---|---|---|
| $key | string | |
| $message | string |
| Type | Description |
|---|---|
| mixed |

beforeRemove(
)
:
booleanCan contain pre-removal logic; return false to prevent remove.
| Type | Description |
|---|---|
| boolean |

checkPermissions(
)
:
booleanReturn true here to allow access to this processor.
Inherited from: \modObjectProcessor::checkPermissions()| Type | Description |
|---|---|
| boolean |

failure(
string $msg
=
'', mixed $object
=
null
)
:
array | stringReturn a failure message from the processor.
Inherited from: \modProcessor::failure()\modObjectProcessor::failure()| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

fireBeforeRemoveEvent(
)
:
booleanIf specified, fire the before remove event
| Type | Description |
|---|---|
| boolean | Return false to allow removal; non-empty to prevent it |

getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\TheReturn the proper instance of the derived class. This can be used to override how MODX loads a processor class; for example, when handling derivative classes with class_key settings.
Inherited from: \modProcessor::getInstance()\modObjectProcessor::getInstance()| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX object. |
| $className | string | The name of the class that is being requested. |
| $properties | array | An array of properties being run with the processor |
| Type | Description |
|---|---|
| \The | class specified by $className |
- Static

getLanguageTopics(
)
:
arrayLoad a collection of Language Topics for this processor.
Inherited from: \modObjectProcessor::getLanguageTopics()Override this in your derivative class to provide the array of topics to load.
| Type | Description |
|---|---|
| array |

getProperties(
)
:
arrayGet an array of properties for this processor
Inherited from: \modProcessor::getProperties()\modObjectProcessor::getProperties()| Type | Description |
|---|---|
| array |

getProperty(
string $k, mixed $default
=
null
)
:
mixedGet a specific property.
Inherited from: \modProcessor::getProperty()\modObjectProcessor::getProperty()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $default | mixed |
| Type | Description |
|---|---|
| mixed |

hasErrors(
)
:
booleanReturn whether or not the processor has errors
Inherited from: \modProcessor::hasErrors()\modObjectProcessor::hasErrors()| Type | Description |
|---|---|
| boolean |

initialize(
)
:
booleanCan be used to provide custom methods prior to processing. Return true to tell MODX that the Processor initialized successfully. If you return anything else, MODX will output that return value as an error message.
| Type | Description |
|---|---|
| boolean |

outputArray(
array $array, mixed $count
=
false
)
:
stringReturn arrays of objects (with count) converted to JSON.
Inherited from: \modProcessor::outputArray()\modObjectProcessor::outputArray()The JSON result includes two main elements, total and results. This format is used for list results.
| Name | Type | Description |
|---|---|---|
| $array | array | An array of data objects. |
| $count | mixed | The total number of objects. Used for pagination. |
| Type | Description |
|---|---|
| string | The JSON output. |
- Access
- public

process(
)
:
mixedRun the processor and return the result. Override this in your derivative class to provide custom functionality.
Used here for pre-2.2-style processors.
| Type | Description |
|---|---|
| mixed |

processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
stringProcesses a response from a Plugin Event invocation
Inherited from: \modProcessor::processEventResponse()\modObjectProcessor::processEventResponse()| Name | Type | Description |
|---|---|---|
| $response | array | string | The response generated by the invokeEvent call |
| $separator | string | The separator for each event response |
| Type | Description |
|---|---|
| string | The processed response. |

run(
)
:
\modProcessorResponseRun the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()\modObjectProcessor::run()| Type | Description |
|---|---|
| \modProcessorResponse |

setCheckbox(
string $k, boolean $force
=
false
)
:
int | nullSpecial helper method for handling checkboxes. Only set value if passed or $force is true, and check for a not empty value or string 'false'.
Inherited from: \modProcessor::setCheckbox()\modObjectProcessor::setCheckbox()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $force | boolean |
| Type | Description |
|---|---|
| int | null |

setDefaultProperties(
array $properties
=
array()
)
:
arraySets default properties that only are set if they don't already exist in the request
Inherited from: \modProcessor::setDefaultProperties()\modObjectProcessor::setDefaultProperties()| Name | Type | Description |
|---|---|---|
| $properties | array |
| Type | Description |
|---|---|
| array | The newly merged properties array |

setPath(
string $path
)
:
voidSet the path of the processor
Inherited from: \modProcessor::setPath()\modObjectProcessor::setPath()| Name | Type | Description |
|---|---|---|
| $path | string | The absolute path |

setProperties(
array $properties
)
:
voidSet the runtime properties for the processor
Inherited from: \modProcessor::setProperties()\modObjectProcessor::setProperties()| Name | Type | Description |
|---|---|---|
| $properties | array | The properties, in array and key-value form, to run on this processor |

setProperty(
string $k, mixed $v
)
:
voidSet a property value
Inherited from: \modProcessor::setProperty()\modObjectProcessor::setProperty()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $v | mixed |

success(
string $msg
=
'', mixed $object
=
null
)
:
array | stringReturn a success message from the processor.
Inherited from: \modProcessor::success()\modObjectProcessor::success()| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

toJSON(
mixed $data
)
:
stringConverts PHP to JSON with JavaScript literals left in-tact.
Inherited from: \modProcessor::toJSON()\modObjectProcessor::toJSON()JSON does not allow JavaScript literals, but this function encodes certain identifiable literals and decodes them back into literals after modX::toJSON() formats the data.
| Name | Type | Description |
|---|---|---|
| $data | mixed | The PHP data to be converted. |
| Type | Description |
|---|---|
| string | The extended JSON-encoded string. |
- Access
- public

unsetProperty(
string $key
)
:
voidCompletely unset a property from the properties array
Inherited from: \modProcessor::unsetProperty()\modObjectProcessor::unsetProperty()| Name | Type | Description |
|---|---|---|
| $key | string |
\modObjectUpdateProcessor
A utility abstract class for defining update-based processors
{@inheritdoc}
- Parent(s)
- \modObjectProcessor < \modProcessor
- Children
- \modResourceUpdateProcessor
- \modUserUpdateProcessor
- \modAccessPolicyTemplateUpdateProcessor
- \modAccessPolicyUpdateProcessor
- \modUserGroupUpdateProcessor
- \modFormCustomizationSetUpdateProcessor
- \modFormCustomizationProfileUpdateProcessor
- \modUserGroupRoleUpdateProcessor
- \modSystemSettingsUpdateProcessor
- \modContentTypeUpdateProcessor
- \modActionUpdateProcessor
- \modDashboardWidgetUpdateProcessor
- \modDashboardUpdateProcessor
- \modContextUpdateProcessor
- \modSourceUpdateProcessor
- \modNamespaceUpdateProcessor
- \modProviderUpdateProcessor
- \modPropertySetUpdateProcessor
- \modElementCategoryUpdateProcessor
- \modPluginDeactivateProcessor
- \modPluginActivateProcessor
- \modElementUpdateProcessor
- Abstract
Properties

string
$afterSaveEvent= ''''
''Details- Type
- string

string
$beforeSaveEvent= ''''
''Details- Type
- string

string
$classKey= ''
- Type
- string
- Inherited_from
- \modObjectProcessor::$$classKey

array
$languageTopics= 'array()'
array()Details- Type
- array
- Inherited_from
- \modObjectProcessor::$$languageTopics

\modX
$modx= 'null'
A reference to the modX object.
Inherited from: \modProcessor::$$modx\modObjectProcessor::$$modxnullDetails- Type
- \modX
- Inherited_from
- \modProcessor::$$modx
- Inherited_from
- \modObjectProcessor::$$modx

\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject
- Inherited_from
- \modObjectProcessor::$$object

string
$objectType= ''object''
'object'Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$objectType

string
$path= ''''
The absolute path to this processor
Inherited from: \modProcessor::$$path\modObjectProcessor::$$path''Details- Type
- string
- Inherited_from
- \modProcessor::$$path
- Inherited_from
- \modObjectProcessor::$$path

string
$permission= ''''
''Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$permission

string
$primaryKeyField= ''id''
'id'Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$primaryKeyField

array
$properties= 'array()'
The array of properties being passed to this processor
Inherited from: \modProcessor::$$properties\modObjectProcessor::$$propertiesarray()Details- Type
- array
- Inherited_from
- \modProcessor::$$properties
- Inherited_from
- \modObjectProcessor::$$properties
Methods

__construct(
\modX $modx, array $properties
=
array()
)
:
voidCreates a modProcessor object.
Inherited from: \modProcessor::__construct()\modObjectProcessor::__construct()| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX instance |
| $properties | array | An array of properties |

_decodeLiterals(
string $string
)
:
stringDecodes strings encoded by _encodeLiterals to restore JavaScript literals.
Inherited from: \modProcessor::_decodeLiterals()\modObjectProcessor::_decodeLiterals()| Name | Type | Description |
|---|---|---|
| $string | string | The JSON-encoded string with encoded literals. |
| Type | Description |
|---|---|
| string | The JSON-encoded string with literals restored. |
- Access
- protected

_encodeLiterals(
mixed $value, integer | string $key
)
:
voidEncodes certain JavaScript literal strings for later decoding.
Inherited from: \modProcessor::_encodeLiterals()\modObjectProcessor::_encodeLiterals()| Name | Type | Description |
|---|---|---|
| $value | mixed | &$value A reference to the value to be encoded if it is identified as a literal. |
| $key | integer | string | The array key corresponding to the value. |
- Access
- protected

addFieldError(
string $key, string $message
=
''
)
:
mixedAdd an error to the field
Inherited from: \modProcessor::addFieldError()\modObjectProcessor::addFieldError()| Name | Type | Description |
|---|---|---|
| $key | string | |
| $message | string |
| Type | Description |
|---|---|
| mixed |

afterSave(
)
:
booleanOverride in your derivative class to do functionality after save() is run
| Type | Description |
|---|---|
| boolean |

beforeSave(
)
:
booleanOverride in your derivative class to do functionality before save() is run
| Type | Description |
|---|---|
| boolean |

beforeSet(
)
:
booleanOverride in your derivative class to do functionality before the fields are set on the object
| Type | Description |
|---|---|
| boolean |

checkPermissions(
)
:
booleanReturn true here to allow access to this processor.
Inherited from: \modObjectProcessor::checkPermissions()| Type | Description |
|---|---|
| boolean |

failure(
string $msg
=
'', mixed $object
=
null
)
:
array | stringReturn a failure message from the processor.
Inherited from: \modProcessor::failure()\modObjectProcessor::failure()| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

fireBeforeSaveEvent(
)
:
booleanFire before save event. Return true to prevent saving.
| Type | Description |
|---|---|
| boolean |

getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\TheReturn the proper instance of the derived class. This can be used to override how MODX loads a processor class; for example, when handling derivative classes with class_key settings.
Inherited from: \modProcessor::getInstance()\modObjectProcessor::getInstance()| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX object. |
| $className | string | The name of the class that is being requested. |
| $properties | array | An array of properties being run with the processor |
| Type | Description |
|---|---|
| \The | class specified by $className |
- Static

getLanguageTopics(
)
:
arrayLoad a collection of Language Topics for this processor.
Inherited from: \modObjectProcessor::getLanguageTopics()Override this in your derivative class to provide the array of topics to load.
| Type | Description |
|---|---|
| array |

getProperties(
)
:
arrayGet an array of properties for this processor
Inherited from: \modProcessor::getProperties()\modObjectProcessor::getProperties()| Type | Description |
|---|---|
| array |

getProperty(
string $k, mixed $default
=
null
)
:
mixedGet a specific property.
Inherited from: \modProcessor::getProperty()\modObjectProcessor::getProperty()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $default | mixed |
| Type | Description |
|---|---|
| mixed |

hasErrors(
)
:
booleanReturn whether or not the processor has errors
Inherited from: \modProcessor::hasErrors()\modObjectProcessor::hasErrors()| Type | Description |
|---|---|
| boolean |

initialize(
)
:
booleanCan be used to provide custom methods prior to processing. Return true to tell MODX that the Processor initialized successfully. If you return anything else, MODX will output that return value as an error message.
| Type | Description |
|---|---|
| boolean |

outputArray(
array $array, mixed $count
=
false
)
:
stringReturn arrays of objects (with count) converted to JSON.
Inherited from: \modProcessor::outputArray()\modObjectProcessor::outputArray()The JSON result includes two main elements, total and results. This format is used for list results.
| Name | Type | Description |
|---|---|---|
| $array | array | An array of data objects. |
| $count | mixed | The total number of objects. Used for pagination. |
| Type | Description |
|---|---|
| string | The JSON output. |
- Access
- public

process(
)
:
mixedRun the processor and return the result. Override this in your derivative class to provide custom functionality.
Used here for pre-2.2-style processors.
| Type | Description |
|---|---|
| mixed |

processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
stringProcesses a response from a Plugin Event invocation
Inherited from: \modProcessor::processEventResponse()\modObjectProcessor::processEventResponse()| Name | Type | Description |
|---|---|---|
| $response | array | string | The response generated by the invokeEvent call |
| $separator | string | The separator for each event response |
| Type | Description |
|---|---|
| string | The processed response. |

run(
)
:
\modProcessorResponseRun the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()\modObjectProcessor::run()| Type | Description |
|---|---|
| \modProcessorResponse |

saveObject(
)
:
booleanAbstract the saving of the object out to allow for transient and non-persistent object updating in derivative classes
| Type | Description |
|---|---|
| boolean |

setCheckbox(
string $k, boolean $force
=
false
)
:
int | nullSpecial helper method for handling checkboxes. Only set value if passed or $force is true, and check for a not empty value or string 'false'.
Inherited from: \modProcessor::setCheckbox()\modObjectProcessor::setCheckbox()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $force | boolean |
| Type | Description |
|---|---|
| int | null |

setDefaultProperties(
array $properties
=
array()
)
:
arraySets default properties that only are set if they don't already exist in the request
Inherited from: \modProcessor::setDefaultProperties()\modObjectProcessor::setDefaultProperties()| Name | Type | Description |
|---|---|---|
| $properties | array |
| Type | Description |
|---|---|
| array | The newly merged properties array |

setPath(
string $path
)
:
voidSet the path of the processor
Inherited from: \modProcessor::setPath()\modObjectProcessor::setPath()| Name | Type | Description |
|---|---|---|
| $path | string | The absolute path |

setProperties(
array $properties
)
:
voidSet the runtime properties for the processor
Inherited from: \modProcessor::setProperties()\modObjectProcessor::setProperties()| Name | Type | Description |
|---|---|---|
| $properties | array | The properties, in array and key-value form, to run on this processor |

setProperty(
string $k, mixed $v
)
:
voidSet a property value
Inherited from: \modProcessor::setProperty()\modObjectProcessor::setProperty()| Name | Type | Description |
|---|---|---|
| $k | string | |
| $v | mixed |

success(
string $msg
=
'', mixed $object
=
null
)
:
array | stringReturn a success message from the processor.
Inherited from: \modProcessor::success()\modObjectProcessor::success()| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

toJSON(
mixed $data
)
:
stringConverts PHP to JSON with JavaScript literals left in-tact.
Inherited from: \modProcessor::toJSON()\modObjectProcessor::toJSON()JSON does not allow JavaScript literals, but this function encodes certain identifiable literals and decodes them back into literals after modX::toJSON() formats the data.
| Name | Type | Description |
|---|---|---|
| $data | mixed | The PHP data to be converted. |
| Type | Description |
|---|---|
| string | The extended JSON-encoded string. |
- Access
- public

unsetProperty(
string $key
)
:
voidCompletely unset a property from the properties array
Inherited from: \modProcessor::unsetProperty()\modObjectProcessor::unsetProperty()| Name | Type | Description |
|---|---|---|
| $key | string |
\modProcessor
Abstracts a MODX processor, handling its response and error formatting.
{@inheritdoc}
- Children
- \modDeprecatedProcessor
- \modDriverSpecificProcessor
- \modObjectProcessor
- \modResourceEventGetListProcessor
- \modResourceEventUpdateFromGrid
- \modResourceReloadProcessor
- \modResourceUnPublishProcessor
- \modResourceEmptyRecycleBinProcessor
- \modResourcePublishProcessor
- \modResourceGroupResourceGetListProcessor
- \modResourceUnDeleteProcessor
- \modResourceGetNodesProcessor
- \modResourceLocksReleaseProcessor
- \modResourceLocksStealProcessor
- \modResourceGetToolbarProcessor
- \modResourceDuplicateProcessor
- \modResourceDataProcessor
- \modResourceDeleteProcessor
- \modResourceSortProcessor
- \modUserDeactivateMultipleProcessor
- \modUserActivateMultipleProcessor
- \modFlushPermissionsProcessor
- \modResourceGroupRemoveProcessor
- \modResourceGroupRemoveResourceProcessor
- \modResourceGroupGetNodesProcessor
- \modResourceGroupCreateProcessor
- \modResourceGroupUpdateProcessor
- \modSecurityFlushProcessor
- \modUserGroupUserRemoveProcessor
- \modSecurityGroupUserCreateProcessor
- \modUserGroupUserUpdateProcessor
- \modSecurityGroupGetNodesProcessor
- \modUserGroupSortProcessor
- \modFormCustomizationSetRemoveMultipleProcessor
- \modFormCustomizationProfileRemoveMultipleProcessor
- \modProfileChangePasswordProcessor
- \modProfileGetProcessor
- \modProfileUpdateProcessor
- \modSystemEventGetListProcessor
- \modSystemPhpThumbProcessor
- \modSystemSettingsGetAreasProcessor
- \modSystemRemoveLocksProcessor
- \modSystemPhpInfoProcessor
- \modSystemLanguageGetListProcessor
- \modContentTypeUpdateFromGridProcessor
- \modSystemDownloadOutputProcessor
- \modSystemRteGetListProcessor
- \modCountryGetListProcessor
- \modCharsetGetListProcessor
- \modSystemDerivativesGetListProcessor
- \modSystemClearCacheProcessor
- \modSystemInfoProcessor
- \modActionGetNodesProcessor
- \modActionSortProcessor
- \modConsoleProcessor
- \modDashboardRemoveMultipleProcessor
- \modDashboardWidgetRemoveMultipleProcessor
- \modSystemLogTruncateProcessor
- \modSystemLogGetListProcessor
- \modSystemErrorLogClearProcessor
- \modSystemErrorLogDownloadProcessor
- \modSystemErrorLogGetProcessor
- \modContextUpdateFromGridProcessor
- \modBrowserFileRemoveProcessor
- \modBrowserFileUploadProcessor
- \modBrowserFileRenameProcessor
- \modBrowserFileDownloadProcessor
- \modBrowserFileCreateProcessor
- \modBrowserFileGetProcessor
- \modBrowserFileUpdateProcessor
- \modBrowserFolderRemoveProcessor
- \modBrowserFolderRenameProcessor
- \modBrowserFolderChmodProcessor
- \modBrowserFolderGetListProcessor
- \modBrowserFolderCreateProcessor
- \modBrowserFolderGetFilesProcessor
- \modBrowserFolderUpdateProcessor
- \modBrowserFolderSortProcessor
- \modSourceRemoveMultipleProcessor
- \modMediaSourceTypeGetListProcessor
- \modNamespaceRemoveMultipleProcessor
- \modProviderGetProcessor
- \modLexiconReloadFromBaseProcessor
- \modLexiconEntryRevertProcessor
- \modLexiconGetListProcessor
- \modLexiconEntryUpdateFromGridProcessor
- \modLexiconEntryCreateProcessor
- \modLexiconTopicGetListProcessor
- \modPackageRemoveProcessor
- \modPackageViewProcessor
- \modPackageInstallProcessor
- \modPackageGetAttributeProcessor
- \modPackageVersionRemoveProcessor
- \modPackageCheckForUpdatesProcessor
- \modPackageGetNodesProcessor
- \modPackageRemoteGetListProcessor
- \modPackageGetInfoProcessor
- \modPackageDownloadProcessor
- \modPackageUpdateProcessor
- \modPackageScanLocalProcessor
- \modPackageUninstallProcessor
- \modElementGetClassesProcessor
- \modElementExportPropertiesProcessor
- \modElementGetNodesProcessor
- \modElementImportPropertiesProcessor
- \modElementTvResourceGroupGetListProcessor
- \modElementTvTemplateGetList
- \modElementTvTemplateUpdateFromGrid
- \modElementTvRendersGetInputsProcessor
- \modTvRendersGetPropertiesProcessor
- \modElementGetInsertProperties
- \modElementGetListByClass
- \modElementSortProcessor
Properties
Methods

__construct(
\modX $modx, array $properties
=
array()
)
:
voidCreates a modProcessor object.
| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX instance |
| $properties | array | An array of properties |

_decodeLiterals(
string $string
)
:
stringDecodes strings encoded by _encodeLiterals to restore JavaScript literals.
| Name | Type | Description |
|---|---|---|
| $string | string | The JSON-encoded string with encoded literals. |
| Type | Description |
|---|---|
| string | The JSON-encoded string with literals restored. |
- Access
- protected

_encodeLiterals(
mixed $value, integer | string $key
)
:
voidEncodes certain JavaScript literal strings for later decoding.
| Name | Type | Description |
|---|---|---|
| $value | mixed | &$value A reference to the value to be encoded if it is identified as a literal. |
| $key | integer | string | The array key corresponding to the value. |
- Access
- protected

addFieldError(
string $key, string $message
=
''
)
:
mixedAdd an error to the field
| Name | Type | Description |
|---|---|---|
| $key | string | |
| $message | string |
| Type | Description |
|---|---|
| mixed |

checkPermissions(
)
:
booleanReturn true here to allow access to this processor.
| Type | Description |
|---|---|
| boolean |

failure(
string $msg
=
'', mixed $object
=
null
)
:
array | stringReturn a failure message from the processor.
| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\TheReturn the proper instance of the derived class. This can be used to override how MODX loads a processor class; for example, when handling derivative classes with class_key settings.
| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX object. |
| $className | string | The name of the class that is being requested. |
| $properties | array | An array of properties being run with the processor |
| Type | Description |
|---|---|
| \The | class specified by $className |
- Static

getLanguageTopics(
)
:
arrayLoad a collection of Language Topics for this processor.
Override this in your derivative class to provide the array of topics to load.
| Type | Description |
|---|---|
| array |

getProperties(
)
:
arrayGet an array of properties for this processor
| Type | Description |
|---|---|
| array |

getProperty(
string $k, mixed $default
=
null
)
:
mixedGet a specific property.
| Name | Type | Description |
|---|---|---|
| $k | string | |
| $default | mixed |
| Type | Description |
|---|---|
| mixed |

hasErrors(
)
:
booleanReturn whether or not the processor has errors
| Type | Description |
|---|---|
| boolean |

initialize(
)
:
booleanCan be used to provide custom methods prior to processing. Return true to tell MODX that the Processor initialized successfully. If you return anything else, MODX will output that return value as an error message.
| Type | Description |
|---|---|
| boolean |

outputArray(
array $array, mixed $count
=
false
)
:
stringReturn arrays of objects (with count) converted to JSON.
The JSON result includes two main elements, total and results. This format is used for list results.
| Name | Type | Description |
|---|---|---|
| $array | array | An array of data objects. |
| $count | mixed | The total number of objects. Used for pagination. |
| Type | Description |
|---|---|
| string | The JSON output. |
- Access
- public

process(
)
:
mixedRun the processor and return the result. Override this in your derivative class to provide custom functionality.
Used here for pre-2.2-style processors.
| Type | Description |
|---|---|
| mixed |

processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
stringProcesses a response from a Plugin Event invocation
| Name | Type | Description |
|---|---|---|
| $response | array | string | The response generated by the invokeEvent call |
| $separator | string | The separator for each event response |
| Type | Description |
|---|---|
| string | The processed response. |

run(
)
:
\modProcessorResponseRun the processor, returning a modProcessorResponse object.
| Type | Description |
|---|---|
| \modProcessorResponse |

setCheckbox(
string $k, boolean $force
=
false
)
:
int | nullSpecial helper method for handling checkboxes. Only set value if passed or $force is true, and check for a not empty value or string 'false'.
| Name | Type | Description |
|---|---|---|
| $k | string | |
| $force | boolean |
| Type | Description |
|---|---|
| int | null |

setDefaultProperties(
array $properties
=
array()
)
:
arraySets default properties that only are set if they don't already exist in the request
| Name | Type | Description |
|---|---|---|
| $properties | array |
| Type | Description |
|---|---|
| array | The newly merged properties array |

setPath(
string $path
)
:
voidSet the path of the processor
| Name | Type | Description |
|---|---|---|
| $path | string | The absolute path |

setProperties(
array $properties
)
:
voidSet the runtime properties for the processor
| Name | Type | Description |
|---|---|---|
| $properties | array | The properties, in array and key-value form, to run on this processor |

setProperty(
string $k, mixed $v
)
:
voidSet a property value
| Name | Type | Description |
|---|---|---|
| $k | string | |
| $v | mixed |

success(
string $msg
=
'', mixed $object
=
null
)
:
array | stringReturn a success message from the processor.
| Name | Type | Description |
|---|---|---|
| $msg | string | |
| $object | mixed |
| Type | Description |
|---|---|
| array | string |

toJSON(
mixed $data
)
:
stringConverts PHP to JSON with JavaScript literals left in-tact.
JSON does not allow JavaScript literals, but this function encodes certain identifiable literals and decodes them back into literals after modX::toJSON() formats the data.
| Name | Type | Description |
|---|---|---|
| $data | mixed | The PHP data to be converted. |
| Type | Description |
|---|---|
| string | The extended JSON-encoded string. |
- Access
- public
\modProcessorResponse
Response class for Processor executions
Constants
Properties

array
$errors= 'array()'
array()Details- Type
- array
Methods

__construct(
\modX $modx, array $response
=
array()
)
:
voidThe constructor for modProcessorResponse
| Name | Type | Description |
|---|---|---|
| $modx | \modX | A reference to the modX object. |
| $response | array | The array response from the modX.runProcessor method |

getAllErrors(
string $fieldErrorSeparator
=
': '
)
:
arrayGets all errors and adds them all into an array.
| Name | Type | Description |
|---|---|---|
| $fieldErrorSeparator | string | The separator to use between fieldkey and message for field-specific errors. |
| Type | Description |
|---|---|
| array | An array of all errors. |

getErrorType(
)
:
stringReturns the type of error for this response
| Type | Description |
|---|---|
| string | The type of error returned |

getFieldErrors(
)
:
arrayAn array of modProcessorResponseError objects for each field-specific error
| Type | Description |
|---|---|
| array |

getMessage(
)
:
stringGets the general status message for the response.
| Type | Description |
|---|---|
| string | The status message |

getObject(
)
:
arrayReturns the array object, if is sent in the response
| Type | Description |
|---|---|
| array | The object in the response, usually the object being performed on. |

getResponse(
)
:
arrayReturns the entire response object in array form
| Type | Description |
|---|---|
| array | The array response |

hasFieldErrors(
)
:
booleanChecks to see if there are any field-specific errors in this response
| Type | Description |
|---|---|
| boolean | True if there were field-specific errors |

hasMessage(
)
:
booleanReturns true if there is a general status message for the response.
| Type | Description |
|---|---|
| boolean | True if there is a general message |

hasObject(
)
:
booleanReturns true if an object was sent with this response.
| Type | Description |
|---|---|
| boolean | True if an object was sent. |
\modProcessorResponseError
An abstraction class of field-specific errors for a processor response
Properties
Methods

__construct(
array $error
=
array()
)
:
voidThe constructor for the modProcessorResponseError class
| Name | Type | Description |
|---|---|---|
| $error | array | An array error response |

getError(
)
:
arrayReturns the array data for the field-specific error
| Type | Description |
|---|---|
| array |

getField(
)
:
stringReturns the field key for the field-specific error
| Type | Description |
|---|---|
| string |