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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
array
$properties= 'array()'
The array of properties being passed to this processor
Inherited from: \modProcessor::$$propertiesarray()
Details- Type
- array
- Inherited_from
- \modProcessor::$$properties
Methods
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
__construct(
\modX $modx, array $properties
=
array()
)
:
void
Name | Type | Description |
---|---|---|
$modx | \modX | A reference to the modX instance |
$properties | array | An array of properties |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_decodeLiterals(
string $string
)
:
string
Decodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_encodeLiterals(
mixed $value, integer | string $key
)
:
void
Encodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
addFieldError(
string $key, string $message
=
''
)
:
mixed
Name | Type | Description |
---|---|---|
$key | string | |
$message | string |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
checkPermissions(
)
:
boolean
Return true here to allow access to this processor.
Inherited from: \modProcessor::checkPermissions()Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
failure(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\The
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getLanguageTopics(
)
:
array
Load 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperties(
)
:
array
Get an array of properties for this processor
Inherited from: \modProcessor::getProperties()Type | Description |
---|---|
array |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperty(
string $k, mixed $default
=
null
)
:
mixed
Name | Type | Description |
---|---|---|
$k | string | |
$default | mixed |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
initialize(
)
:
boolean
Can 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
outputArray(
array $array, mixed $count
=
false
)
:
string
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
process(
)
:
mixed
Rather than load a class for processing, include the processor file directly.
Used here for pre-2.2-style processors.
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
string
Processes 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. |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
run(
)
:
\modProcessorResponse
Run the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()Type | Description |
---|---|
\modProcessorResponse |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setCheckbox(
string $k, boolean $force
=
false
)
:
int | null
Special 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setDefaultProperties(
array $properties
=
array()
)
:
array
Sets 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperties(
array $properties
)
:
void
Set 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
success(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
toJSON(
mixed $data
)
:
string
Converts 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
unsetProperty(
string $key
)
:
void
Completely 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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
array
$properties= 'array()'
The array of properties being passed to this processor
Inherited from: \modProcessor::$$propertiesarray()
Details- Type
- array
- Inherited_from
- \modProcessor::$$properties
Methods
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
__construct(
\modX $modx, array $properties
=
array()
)
:
void
Name | Type | Description |
---|---|---|
$modx | \modX | A reference to the modX instance |
$properties | array | An array of properties |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_decodeLiterals(
string $string
)
:
string
Decodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_encodeLiterals(
mixed $value, integer | string $key
)
:
void
Encodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
addFieldError(
string $key, string $message
=
''
)
:
mixed
Name | Type | Description |
---|---|---|
$key | string | |
$message | string |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
checkPermissions(
)
:
boolean
Return true here to allow access to this processor.
Inherited from: \modProcessor::checkPermissions()Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
failure(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\The
Return 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getLanguageTopics(
)
:
array
Load 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperties(
)
:
array
Get an array of properties for this processor
Inherited from: \modProcessor::getProperties()Type | Description |
---|---|
array |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperty(
string $k, mixed $default
=
null
)
:
mixed
Name | Type | Description |
---|---|---|
$k | string | |
$default | mixed |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
initialize(
)
:
boolean
Can 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
outputArray(
array $array, mixed $count
=
false
)
:
string
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
process(
)
:
mixed
Run 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
string
Processes 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. |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
run(
)
:
\modProcessorResponse
Run the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()Type | Description |
---|---|
\modProcessorResponse |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setCheckbox(
string $k, boolean $force
=
false
)
:
int | null
Special 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setDefaultProperties(
array $properties
=
array()
)
:
array
Sets 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperties(
array $properties
)
:
void
Set 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
success(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
toJSON(
mixed $data
)
:
string
Converts 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
unsetProperty(
string $key
)
:
void
Completely 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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$afterSaveEvent= ''''
''
Details- Type
- string
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$beforeSaveEvent= ''''
''
Details- Type
- string
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$classKey= ''
- Type
- string
- Inherited_from
- \modObjectProcessor::$$classKey
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
array
$languageTopics= 'array()'
array()
Details- Type
- array
- Inherited_from
- \modObjectProcessor::$$languageTopics
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
\modX
$modx= 'null'
A reference to the modX object.
Inherited from: \modProcessor::$$modx\modObjectProcessor::$$modxnull
Details- Type
- \modX
- Inherited_from
- \modProcessor::$$modx
- Inherited_from
- \modObjectProcessor::$$modx
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject
- Inherited_from
- \modObjectProcessor::$$object
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$objectType= ''object''
'object'
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$objectType
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$permission= ''''
''
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$permission
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$primaryKeyField= ''id''
'id'
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$primaryKeyField
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
__construct(
\modX $modx, array $properties
=
array()
)
:
void
Creates 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_decodeLiterals(
string $string
)
:
string
Decodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_encodeLiterals(
mixed $value, integer | string $key
)
:
void
Encodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
addFieldError(
string $key, string $message
=
''
)
:
mixed
Add an error to the field
Inherited from: \modProcessor::addFieldError()\modObjectProcessor::addFieldError()Name | Type | Description |
---|---|---|
$key | string | |
$message | string |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
afterSave(
)
:
boolean
Override in your derivative class to do functionality before save() is run
Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
beforeSave(
)
:
boolean
Override in your derivative class to do functionality after save() is run
Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
beforeSet(
)
:
boolean
Override in your derivative class to do functionality before the fields are set on the object
Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
checkPermissions(
)
:
boolean
Return true here to allow access to this processor.
Inherited from: \modObjectProcessor::checkPermissions()Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
doesAlreadyExist(
array $criteria
)
:
int
Name | Type | Description |
---|---|---|
$criteria | array |
Type | Description |
---|---|
int |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
failure(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return a failure message from the processor.
Inherited from: \modProcessor::failure()\modObjectProcessor::failure()Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
fireBeforeSaveEvent(
)
:
boolean
Fire before save event. Return true to prevent saving.
Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\The
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getLanguageTopics(
)
:
array
Load 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperties(
)
:
array
Get an array of properties for this processor
Inherited from: \modProcessor::getProperties()\modObjectProcessor::getProperties()Type | Description |
---|---|
array |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperty(
string $k, mixed $default
=
null
)
:
mixed
Get a specific property.
Inherited from: \modProcessor::getProperty()\modObjectProcessor::getProperty()Name | Type | Description |
---|---|---|
$k | string | |
$default | mixed |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
hasErrors(
)
:
boolean
Return whether or not the processor has errors
Inherited from: \modProcessor::hasErrors()\modObjectProcessor::hasErrors()Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
initialize(
)
:
boolean
Can 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
outputArray(
array $array, mixed $count
=
false
)
:
string
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
process(
)
:
mixed
Process 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
string
Processes 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. |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
run(
)
:
\modProcessorResponse
Run the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()\modObjectProcessor::run()Type | Description |
---|---|
\modProcessorResponse |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setCheckbox(
string $k, boolean $force
=
false
)
:
int | null
Special 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setDefaultProperties(
array $properties
=
array()
)
:
array
Sets 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setPath(
string $path
)
:
void
Set the path of the processor
Inherited from: \modProcessor::setPath()\modObjectProcessor::setPath()Name | Type | Description |
---|---|---|
$path | string | The absolute path |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperties(
array $properties
)
:
void
Set 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperty(
string $k, mixed $v
)
:
void
Set a property value
Inherited from: \modProcessor::setProperty()\modObjectProcessor::setProperty()Name | Type | Description |
---|---|---|
$k | string | |
$v | mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
success(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return a success message from the processor.
Inherited from: \modProcessor::success()\modObjectProcessor::success()Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
toJSON(
mixed $data
)
:
string
Converts 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
unsetProperty(
string $key
)
:
void
Completely 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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
boolean
$checkSavePermission= 'true'
true
Details- Type
- boolean
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$classKey= ''
- Type
- string
- Inherited_from
- \modObjectProcessor::$$classKey
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
array
$languageTopics= 'array()'
array()
Details- Type
- array
- Inherited_from
- \modObjectProcessor::$$languageTopics
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
\modX
$modx= 'null'
A reference to the modX object.
Inherited from: \modProcessor::$$modx\modObjectProcessor::$$modxnull
Details- Type
- \modX
- Inherited_from
- \modProcessor::$$modx
- Inherited_from
- \modObjectProcessor::$$modx
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject
- Inherited_from
- \modObjectProcessor::$$object
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$objectType= ''object''
'object'
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$objectType
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$permission= ''''
''
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$permission
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$primaryKeyField= ''id''
'id'
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$primaryKeyField
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
__construct(
\modX $modx, array $properties
=
array()
)
:
void
Creates 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_decodeLiterals(
string $string
)
:
string
Decodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_encodeLiterals(
mixed $value, integer | string $key
)
:
void
Encodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
addFieldError(
string $key, string $message
=
''
)
:
mixed
Add an error to the field
Inherited from: \modProcessor::addFieldError()\modObjectProcessor::addFieldError()Name | Type | Description |
---|---|---|
$key | string | |
$message | string |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
afterSave(
)
:
boolean
Run any logic after the object has been duplicated
Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
alreadyExists(
string $name
)
:
boolean
Check to see if an object already exists with that name
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
beforeSave(
)
:
boolean
Run any logic before the object has been duplicated. May return false to prevent duplication.
Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
beforeSet(
)
:
boolean
Override in your derivative class to do functionality before the fields are set on the object
Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
checkPermissions(
)
:
boolean
Return true here to allow access to this processor.
Inherited from: \modObjectProcessor::checkPermissions()Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
failure(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return a failure message from the processor.
Inherited from: \modProcessor::failure()\modObjectProcessor::failure()Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\The
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getLanguageTopics(
)
:
array
Load 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperties(
)
:
array
Get an array of properties for this processor
Inherited from: \modProcessor::getProperties()\modObjectProcessor::getProperties()Type | Description |
---|---|
array |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperty(
string $k, mixed $default
=
null
)
:
mixed
Get a specific property.
Inherited from: \modProcessor::getProperty()\modObjectProcessor::getProperty()Name | Type | Description |
---|---|---|
$k | string | |
$default | mixed |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
hasErrors(
)
:
boolean
Return whether or not the processor has errors
Inherited from: \modProcessor::hasErrors()\modObjectProcessor::hasErrors()Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
initialize(
)
:
boolean
Can 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
outputArray(
array $array, mixed $count
=
false
)
:
string
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
process(
)
:
mixed
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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
string
Processes 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. |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
run(
)
:
\modProcessorResponse
Run the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()\modObjectProcessor::run()Type | Description |
---|---|
\modProcessorResponse |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setCheckbox(
string $k, boolean $force
=
false
)
:
int | null
Special 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setDefaultProperties(
array $properties
=
array()
)
:
array
Sets 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setNewName(
string $name
)
:
string
Set the new name to the new object
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setPath(
string $path
)
:
void
Set the path of the processor
Inherited from: \modProcessor::setPath()\modObjectProcessor::setPath()Name | Type | Description |
---|---|---|
$path | string | The absolute path |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperties(
array $properties
)
:
void
Set 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperty(
string $k, mixed $v
)
:
void
Set a property value
Inherited from: \modProcessor::setProperty()\modObjectProcessor::setProperty()Name | Type | Description |
---|---|---|
$k | string | |
$v | mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
success(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return a success message from the processor.
Inherited from: \modProcessor::success()\modObjectProcessor::success()Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
toJSON(
mixed $data
)
:
string
Converts 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
unsetProperty(
string $key
)
:
void
Completely 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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
boolean
$checkViewPermission= 'true'
true
Details- Type
- boolean
- Inherited_from
- \modObjectGetProcessor::$$checkViewPermission
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$classKey= ''
- Type
- string
- Inherited_from
- \modObjectProcessor::$$classKey
- Inherited_from
- \modObjectGetProcessor::$$classKey
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
array
$languageTopics= 'array()'
array()
Details- Type
- array
- Inherited_from
- \modObjectProcessor::$$languageTopics
- Inherited_from
- \modObjectGetProcessor::$$languageTopics
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
\modX
$modx= 'null'
A reference to the modX object.
Inherited from: \modProcessor::$$modx\modObjectProcessor::$$modx\modObjectGetProcessor::$$modxnull
Details- Type
- \modX
- Inherited_from
- \modProcessor::$$modx
- Inherited_from
- \modObjectProcessor::$$modx
- Inherited_from
- \modObjectGetProcessor::$$modx
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject
- Inherited_from
- \modObjectProcessor::$$object
- Inherited_from
- \modObjectGetProcessor::$$object
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$objectType= ''object''
'object'
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$objectType
- Inherited_from
- \modObjectGetProcessor::$$objectType
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$permission= ''''
''
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$permission
- Inherited_from
- \modObjectGetProcessor::$$permission
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$primaryKeyField= ''id''
'id'
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$primaryKeyField
- Inherited_from
- \modObjectGetProcessor::$$primaryKeyField
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
__construct(
\modX $modx, array $properties
=
array()
)
:
void
Creates 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_decodeLiterals(
string $string
)
:
string
Decodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_encodeLiterals(
mixed $value, integer | string $key
)
:
void
Encodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
addFieldError(
string $key, string $message
=
''
)
:
mixed
Add an error to the field
Inherited from: \modProcessor::addFieldError()\modObjectProcessor::addFieldError()\modObjectGetProcessor::addFieldError()Name | Type | Description |
---|---|---|
$key | string | |
$message | string |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
beforeOutput(
)
:
void
Used for adding custom data in derivative types
Inherited from: \modObjectGetProcessor::beforeOutput()![](images/icons/arrow_right.png)
![method](images/icons/method.png)
checkPermissions(
)
:
boolean
Return true here to allow access to this processor.
Inherited from: \modObjectProcessor::checkPermissions()\modObjectGetProcessor::checkPermissions()Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
download(
)
:
mixed
Attempt to download the exported file to the browser
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
failure(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\The
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getLanguageTopics(
)
:
array
Load 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperties(
)
:
array
Get an array of properties for this processor
Inherited from: \modProcessor::getProperties()\modObjectProcessor::getProperties()\modObjectGetProcessor::getProperties()Type | Description |
---|---|
array |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperty(
string $k, mixed $default
=
null
)
:
mixed
Get a specific property.
Inherited from: \modProcessor::getProperty()\modObjectProcessor::getProperty()\modObjectGetProcessor::getProperty()Name | Type | Description |
---|---|---|
$k | string | |
$default | mixed |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
hasErrors(
)
:
boolean
Return whether or not the processor has errors
Inherited from: \modProcessor::hasErrors()\modObjectProcessor::hasErrors()\modObjectGetProcessor::hasErrors()Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
initialize(
)
:
boolean
Can 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
outputArray(
array $array, mixed $count
=
false
)
:
string
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
prepareXml(
)
:
void
Must be declared in your derivative class. Used to prepare the data to export.
- Abstract
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
process(
)
:
mixed
Run 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
string
Processes 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. |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
run(
)
:
\modProcessorResponse
Run the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()\modObjectProcessor::run()\modObjectGetProcessor::run()Type | Description |
---|---|
\modProcessorResponse |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setCheckbox(
string $k, boolean $force
=
false
)
:
int | null
Special 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setDefaultProperties(
array $properties
=
array()
)
:
array
Sets 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setPath(
string $path
)
:
void
Set the path of the processor
Inherited from: \modProcessor::setPath()\modObjectProcessor::setPath()\modObjectGetProcessor::setPath()Name | Type | Description |
---|---|---|
$path | string | The absolute path |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperties(
array $properties
)
:
void
Set 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperty(
string $k, mixed $v
)
:
void
Set a property value
Inherited from: \modProcessor::setProperty()\modObjectProcessor::setProperty()\modObjectGetProcessor::setProperty()Name | Type | Description |
---|---|---|
$k | string | |
$v | mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
success(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
toJSON(
mixed $data
)
:
string
Converts 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
unsetProperty(
string $key
)
:
void
Completely 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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
boolean
$checkListPermission= 'true'
true
Details- Type
- boolean
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$classKey= ''
- Type
- string
- Inherited_from
- \modObjectProcessor::$$classKey
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$defaultSortDirection= ''ASC''
'ASC'
Details- Type
- string
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$defaultSortField= ''name''
'name'
Details- Type
- string
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
array
$languageTopics= 'array()'
array()
Details- Type
- array
- Inherited_from
- \modObjectProcessor::$$languageTopics
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
\modX
$modx= 'null'
A reference to the modX object.
Inherited from: \modProcessor::$$modx\modObjectProcessor::$$modxnull
Details- Type
- \modX
- Inherited_from
- \modProcessor::$$modx
- Inherited_from
- \modObjectProcessor::$$modx
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject
- Inherited_from
- \modObjectProcessor::$$object
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$objectType= ''object''
'object'
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$objectType
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$permission= ''''
''
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$permission
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$primaryKeyField= ''id''
'id'
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$primaryKeyField
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
__construct(
\modX $modx, array $properties
=
array()
)
:
void
Creates 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_decodeLiterals(
string $string
)
:
string
Decodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_encodeLiterals(
mixed $value, integer | string $key
)
:
void
Encodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
addFieldError(
string $key, string $message
=
''
)
:
mixed
Add an error to the field
Inherited from: \modProcessor::addFieldError()\modObjectProcessor::addFieldError()Name | Type | Description |
---|---|---|
$key | string | |
$message | string |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
afterIteration(
array $list
)
:
array
Can be used to insert a row after iteration
Name | Type | Description |
---|---|---|
$list | array |
Type | Description |
---|---|
array |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
beforeIteration(
array $list
)
:
array
Can be used to insert a row before iteration
Name | Type | Description |
---|---|---|
$list | array |
Type | Description |
---|---|
array |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
checkPermissions(
)
:
boolean
Return true here to allow access to this processor.
Inherited from: \modObjectProcessor::checkPermissions()Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
failure(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return a failure message from the processor.
Inherited from: \modProcessor::failure()\modObjectProcessor::failure()Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\The
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getLanguageTopics(
)
:
array
Load 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperties(
)
:
array
Get an array of properties for this processor
Inherited from: \modProcessor::getProperties()\modObjectProcessor::getProperties()Type | Description |
---|---|
array |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperty(
string $k, mixed $default
=
null
)
:
mixed
Get a specific property.
Inherited from: \modProcessor::getProperty()\modObjectProcessor::getProperty()Name | Type | Description |
---|---|---|
$k | string | |
$default | mixed |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getSortClassKey(
)
:
string
Can be used to provide a custom sorting class key for the default sorting columns
Type | Description |
---|---|
string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
hasErrors(
)
:
boolean
Return whether or not the processor has errors
Inherited from: \modProcessor::hasErrors()\modObjectProcessor::hasErrors()Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
initialize(
)
:
boolean
Can 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
iterate(
array $data
)
:
array
Iterate across the data
Name | Type | Description |
---|---|---|
$data | array |
Type | Description |
---|---|
array |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
outputArray(
array $array, mixed $count
=
false
)
:
string
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
prepareQueryAfterCount(
\xPDOQuery $c
)
:
\xPDOQuery
Can be used to prepare the query after the COUNT statement
Name | Type | Description |
---|---|---|
$c | \xPDOQuery |
Type | Description |
---|---|
\xPDOQuery |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
prepareQueryBeforeCount(
\xPDOQuery $c
)
:
\xPDOQuery
Can be used to adjust the query prior to the COUNT statement
Name | Type | Description |
---|---|---|
$c | \xPDOQuery |
Type | Description |
---|---|
\xPDOQuery |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
prepareRow(
\xPDOObject $object
)
:
array
Prepare the row for iteration
Name | Type | Description |
---|---|---|
$object | \xPDOObject |
Type | Description |
---|---|
array |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
process(
)
:
mixed
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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
string
Processes 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. |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
run(
)
:
\modProcessorResponse
Run the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()\modObjectProcessor::run()Type | Description |
---|---|
\modProcessorResponse |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setCheckbox(
string $k, boolean $force
=
false
)
:
int | null
Special 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setDefaultProperties(
array $properties
=
array()
)
:
array
Sets 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setPath(
string $path
)
:
void
Set the path of the processor
Inherited from: \modProcessor::setPath()\modObjectProcessor::setPath()Name | Type | Description |
---|---|---|
$path | string | The absolute path |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperties(
array $properties
)
:
void
Set 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperty(
string $k, mixed $v
)
:
void
Set a property value
Inherited from: \modProcessor::setProperty()\modObjectProcessor::setProperty()Name | Type | Description |
---|---|---|
$k | string | |
$v | mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
success(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return a success message from the processor.
Inherited from: \modProcessor::success()\modObjectProcessor::success()Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
toJSON(
mixed $data
)
:
string
Converts 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
unsetProperty(
string $key
)
:
void
Completely 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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
boolean
$checkViewPermission= 'true'
true
Details- Type
- boolean
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$classKey= ''
- Type
- string
- Inherited_from
- \modObjectProcessor::$$classKey
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
array
$languageTopics= 'array()'
array()
Details- Type
- array
- Inherited_from
- \modObjectProcessor::$$languageTopics
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
\modX
$modx= 'null'
A reference to the modX object.
Inherited from: \modProcessor::$$modx\modObjectProcessor::$$modxnull
Details- Type
- \modX
- Inherited_from
- \modProcessor::$$modx
- Inherited_from
- \modObjectProcessor::$$modx
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject
- Inherited_from
- \modObjectProcessor::$$object
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$objectType= ''object''
'object'
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$objectType
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$permission= ''''
''
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$permission
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$primaryKeyField= ''id''
'id'
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$primaryKeyField
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
__construct(
\modX $modx, array $properties
=
array()
)
:
void
Creates 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_decodeLiterals(
string $string
)
:
string
Decodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_encodeLiterals(
mixed $value, integer | string $key
)
:
void
Encodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
addFieldError(
string $key, string $message
=
''
)
:
mixed
Add an error to the field
Inherited from: \modProcessor::addFieldError()\modObjectProcessor::addFieldError()Name | Type | Description |
---|---|---|
$key | string | |
$message | string |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
checkPermissions(
)
:
boolean
Return true here to allow access to this processor.
Inherited from: \modObjectProcessor::checkPermissions()Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
failure(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return a failure message from the processor.
Inherited from: \modProcessor::failure()\modObjectProcessor::failure()Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\The
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getLanguageTopics(
)
:
array
Load 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperties(
)
:
array
Get an array of properties for this processor
Inherited from: \modProcessor::getProperties()\modObjectProcessor::getProperties()Type | Description |
---|---|
array |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperty(
string $k, mixed $default
=
null
)
:
mixed
Get a specific property.
Inherited from: \modProcessor::getProperty()\modObjectProcessor::getProperty()Name | Type | Description |
---|---|---|
$k | string | |
$default | mixed |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
hasErrors(
)
:
boolean
Return whether or not the processor has errors
Inherited from: \modProcessor::hasErrors()\modObjectProcessor::hasErrors()Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
initialize(
)
:
boolean
Can 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
outputArray(
array $array, mixed $count
=
false
)
:
string
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
process(
)
:
mixed
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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
string
Processes 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. |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
run(
)
:
\modProcessorResponse
Run the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()\modObjectProcessor::run()Type | Description |
---|---|
\modProcessorResponse |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setCheckbox(
string $k, boolean $force
=
false
)
:
int | null
Special 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setDefaultProperties(
array $properties
=
array()
)
:
array
Sets 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setPath(
string $path
)
:
void
Set the path of the processor
Inherited from: \modProcessor::setPath()\modObjectProcessor::setPath()Name | Type | Description |
---|---|---|
$path | string | The absolute path |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperties(
array $properties
)
:
void
Set 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperty(
string $k, mixed $v
)
:
void
Set a property value
Inherited from: \modProcessor::setProperty()\modObjectProcessor::setProperty()Name | Type | Description |
---|---|---|
$k | string | |
$v | mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
success(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return a success message from the processor.
Inherited from: \modProcessor::success()\modObjectProcessor::success()Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
toJSON(
mixed $data
)
:
string
Converts 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
unsetProperty(
string $key
)
:
void
Completely 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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$classKey= ''
- Type
- string
- Inherited_from
- \modObjectProcessor::$$classKey
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$fileProperty= ''file''
'file'
Details- Type
- string
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
array
$languageTopics= 'array()'
array()
Details- Type
- array
- Inherited_from
- \modObjectProcessor::$$languageTopics
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
\modX
$modx= 'null'
A reference to the modX object.
Inherited from: \modProcessor::$$modx\modObjectProcessor::$$modxnull
Details- Type
- \modX
- Inherited_from
- \modProcessor::$$modx
- Inherited_from
- \modObjectProcessor::$$modx
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$nameField= ''name''
'name'
Details- Type
- string
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject
- Inherited_from
- \modObjectProcessor::$$object
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$objectType= ''object''
'object'
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$objectType
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$permission= ''''
''
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$permission
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$primaryKeyField= ''id''
'id'
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$primaryKeyField
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
boolean
$setName= 'true'
true
Details- Type
- boolean
Methods
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
__construct(
\modX $modx, array $properties
=
array()
)
:
void
Creates 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_decodeLiterals(
string $string
)
:
string
Decodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_encodeLiterals(
mixed $value, integer | string $key
)
:
void
Encodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
addFieldError(
string $key, string $message
=
''
)
:
mixed
Add an error to the field
Inherited from: \modProcessor::addFieldError()\modObjectProcessor::addFieldError()Name | Type | Description |
---|---|---|
$key | string | |
$message | string |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
alreadyExists(
string $name
)
:
bool
Check to see if the object already exists with this name field
Name | Type | Description |
---|---|---|
$name | string |
Type | Description |
---|---|
bool |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
checkPermissions(
)
:
boolean
Return true here to allow access to this processor.
Inherited from: \modObjectProcessor::checkPermissions()Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
failure(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return a failure message from the processor.
Inherited from: \modProcessor::failure()\modObjectProcessor::failure()Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\The
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getLanguageTopics(
)
:
array
Load 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperties(
)
:
array
Get an array of properties for this processor
Inherited from: \modProcessor::getProperties()\modObjectProcessor::getProperties()Type | Description |
---|---|
array |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperty(
string $k, mixed $default
=
null
)
:
mixed
Get a specific property.
Inherited from: \modProcessor::getProperty()\modObjectProcessor::getProperty()Name | Type | Description |
---|---|---|
$k | string | |
$default | mixed |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
hasErrors(
)
:
boolean
Return whether or not the processor has errors
Inherited from: \modProcessor::hasErrors()\modObjectProcessor::hasErrors()Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
initialize(
)
:
boolean
Can 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
outputArray(
array $array, mixed $count
=
false
)
:
string
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
process(
)
:
mixed
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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
string
Processes 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. |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
run(
)
:
\modProcessorResponse
Run the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()\modObjectProcessor::run()Type | Description |
---|---|
\modProcessorResponse |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setCheckbox(
string $k, boolean $force
=
false
)
:
int | null
Special 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setDefaultProperties(
array $properties
=
array()
)
:
array
Sets 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setPath(
string $path
)
:
void
Set the path of the processor
Inherited from: \modProcessor::setPath()\modObjectProcessor::setPath()Name | Type | Description |
---|---|---|
$path | string | The absolute path |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperties(
array $properties
)
:
void
Set 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperty(
string $k, mixed $v
)
:
void
Set a property value
Inherited from: \modProcessor::setProperty()\modObjectProcessor::setProperty()Name | Type | Description |
---|---|---|
$k | string | |
$v | mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
success(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return a success message from the processor.
Inherited from: \modProcessor::success()\modObjectProcessor::success()Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
toJSON(
mixed $data
)
:
string
Converts 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
unsetProperty(
string $key
)
:
void
Completely 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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
array
$languageTopics= 'array()'
array()
Details- Type
- array
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$objectType= ''object''
'object'
Details- Type
- string
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$permission= ''''
''
Details- Type
- string
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$primaryKeyField= ''id''
'id'
Details- Type
- string
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
array
$properties= 'array()'
The array of properties being passed to this processor
Inherited from: \modProcessor::$$propertiesarray()
Details- Type
- array
- Inherited_from
- \modProcessor::$$properties
Methods
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
__construct(
\modX $modx, array $properties
=
array()
)
:
void
Name | Type | Description |
---|---|---|
$modx | \modX | A reference to the modX instance |
$properties | array | An array of properties |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_decodeLiterals(
string $string
)
:
string
Decodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_encodeLiterals(
mixed $value, integer | string $key
)
:
void
Encodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
addFieldError(
string $key, string $message
=
''
)
:
mixed
Name | Type | Description |
---|---|---|
$key | string | |
$message | string |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
checkPermissions(
)
:
boolean
Return true here to allow access to this processor.
Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
failure(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\The
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getLanguageTopics(
)
:
array
Load 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperties(
)
:
array
Get an array of properties for this processor
Inherited from: \modProcessor::getProperties()Type | Description |
---|---|
array |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperty(
string $k, mixed $default
=
null
)
:
mixed
Name | Type | Description |
---|---|---|
$k | string | |
$default | mixed |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
initialize(
)
:
boolean
Can 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
outputArray(
array $array, mixed $count
=
false
)
:
string
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
process(
)
:
mixed
Run 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
string
Processes 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. |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
run(
)
:
\modProcessorResponse
Run the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()Type | Description |
---|---|
\modProcessorResponse |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setCheckbox(
string $k, boolean $force
=
false
)
:
int | null
Special 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setDefaultProperties(
array $properties
=
array()
)
:
array
Sets 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperties(
array $properties
)
:
void
Set 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
success(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
toJSON(
mixed $data
)
:
string
Converts 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
unsetProperty(
string $key
)
:
void
Completely 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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$afterRemoveEvent= ''''
''
Details- Type
- string
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$beforeRemoveEvent= ''''
''
Details- Type
- string
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
boolean
$checkRemovePermission= 'true'
true
Details- Type
- boolean
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$classKey= ''
- Type
- string
- Inherited_from
- \modObjectProcessor::$$classKey
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
array
$languageTopics= 'array()'
array()
Details- Type
- array
- Inherited_from
- \modObjectProcessor::$$languageTopics
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
\modX
$modx= 'null'
A reference to the modX object.
Inherited from: \modProcessor::$$modx\modObjectProcessor::$$modxnull
Details- Type
- \modX
- Inherited_from
- \modProcessor::$$modx
- Inherited_from
- \modObjectProcessor::$$modx
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject
- Inherited_from
- \modObjectProcessor::$$object
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$objectType= ''object''
'object'
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$objectType
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$permission= ''''
''
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$permission
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$primaryKeyField= ''id''
'id'
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$primaryKeyField
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
__construct(
\modX $modx, array $properties
=
array()
)
:
void
Creates 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_decodeLiterals(
string $string
)
:
string
Decodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_encodeLiterals(
mixed $value, integer | string $key
)
:
void
Encodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
addFieldError(
string $key, string $message
=
''
)
:
mixed
Add an error to the field
Inherited from: \modProcessor::addFieldError()\modObjectProcessor::addFieldError()Name | Type | Description |
---|---|---|
$key | string | |
$message | string |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
beforeRemove(
)
:
boolean
Can contain pre-removal logic; return false to prevent remove.
Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
checkPermissions(
)
:
boolean
Return true here to allow access to this processor.
Inherited from: \modObjectProcessor::checkPermissions()Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
failure(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return a failure message from the processor.
Inherited from: \modProcessor::failure()\modObjectProcessor::failure()Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
fireBeforeRemoveEvent(
)
:
boolean
If specified, fire the before remove event
Type | Description |
---|---|
boolean | Return false to allow removal; non-empty to prevent it |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\The
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getLanguageTopics(
)
:
array
Load 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperties(
)
:
array
Get an array of properties for this processor
Inherited from: \modProcessor::getProperties()\modObjectProcessor::getProperties()Type | Description |
---|---|
array |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperty(
string $k, mixed $default
=
null
)
:
mixed
Get a specific property.
Inherited from: \modProcessor::getProperty()\modObjectProcessor::getProperty()Name | Type | Description |
---|---|---|
$k | string | |
$default | mixed |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
hasErrors(
)
:
boolean
Return whether or not the processor has errors
Inherited from: \modProcessor::hasErrors()\modObjectProcessor::hasErrors()Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
initialize(
)
:
boolean
Can 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
outputArray(
array $array, mixed $count
=
false
)
:
string
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
process(
)
:
mixed
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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
string
Processes 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. |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
run(
)
:
\modProcessorResponse
Run the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()\modObjectProcessor::run()Type | Description |
---|---|
\modProcessorResponse |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setCheckbox(
string $k, boolean $force
=
false
)
:
int | null
Special 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setDefaultProperties(
array $properties
=
array()
)
:
array
Sets 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setPath(
string $path
)
:
void
Set the path of the processor
Inherited from: \modProcessor::setPath()\modObjectProcessor::setPath()Name | Type | Description |
---|---|---|
$path | string | The absolute path |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperties(
array $properties
)
:
void
Set 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperty(
string $k, mixed $v
)
:
void
Set a property value
Inherited from: \modProcessor::setProperty()\modObjectProcessor::setProperty()Name | Type | Description |
---|---|---|
$k | string | |
$v | mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
success(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return a success message from the processor.
Inherited from: \modProcessor::success()\modObjectProcessor::success()Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
toJSON(
mixed $data
)
:
string
Converts 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
unsetProperty(
string $key
)
:
void
Completely 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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$afterSaveEvent= ''''
''
Details- Type
- string
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$beforeSaveEvent= ''''
''
Details- Type
- string
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$classKey= ''
- Type
- string
- Inherited_from
- \modObjectProcessor::$$classKey
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
array
$languageTopics= 'array()'
array()
Details- Type
- array
- Inherited_from
- \modObjectProcessor::$$languageTopics
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
\modX
$modx= 'null'
A reference to the modX object.
Inherited from: \modProcessor::$$modx\modObjectProcessor::$$modxnull
Details- Type
- \modX
- Inherited_from
- \modProcessor::$$modx
- Inherited_from
- \modObjectProcessor::$$modx
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject
- Inherited_from
- \modObjectProcessor::$$object
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$objectType= ''object''
'object'
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$objectType
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$permission= ''''
''
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$permission
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
string
$primaryKeyField= ''id''
'id'
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$primaryKeyField
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
__construct(
\modX $modx, array $properties
=
array()
)
:
void
Creates 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_decodeLiterals(
string $string
)
:
string
Decodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_encodeLiterals(
mixed $value, integer | string $key
)
:
void
Encodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
addFieldError(
string $key, string $message
=
''
)
:
mixed
Add an error to the field
Inherited from: \modProcessor::addFieldError()\modObjectProcessor::addFieldError()Name | Type | Description |
---|---|---|
$key | string | |
$message | string |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
afterSave(
)
:
boolean
Override in your derivative class to do functionality after save() is run
Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
beforeSave(
)
:
boolean
Override in your derivative class to do functionality before save() is run
Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
beforeSet(
)
:
boolean
Override in your derivative class to do functionality before the fields are set on the object
Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
checkPermissions(
)
:
boolean
Return true here to allow access to this processor.
Inherited from: \modObjectProcessor::checkPermissions()Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
failure(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return a failure message from the processor.
Inherited from: \modProcessor::failure()\modObjectProcessor::failure()Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
fireBeforeSaveEvent(
)
:
boolean
Fire before save event. Return true to prevent saving.
Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\The
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getLanguageTopics(
)
:
array
Load 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperties(
)
:
array
Get an array of properties for this processor
Inherited from: \modProcessor::getProperties()\modObjectProcessor::getProperties()Type | Description |
---|---|
array |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperty(
string $k, mixed $default
=
null
)
:
mixed
Get a specific property.
Inherited from: \modProcessor::getProperty()\modObjectProcessor::getProperty()Name | Type | Description |
---|---|---|
$k | string | |
$default | mixed |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
hasErrors(
)
:
boolean
Return whether or not the processor has errors
Inherited from: \modProcessor::hasErrors()\modObjectProcessor::hasErrors()Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
initialize(
)
:
boolean
Can 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
outputArray(
array $array, mixed $count
=
false
)
:
string
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
process(
)
:
mixed
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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
string
Processes 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. |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
run(
)
:
\modProcessorResponse
Run the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()\modObjectProcessor::run()Type | Description |
---|---|
\modProcessorResponse |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
saveObject(
)
:
boolean
Abstract the saving of the object out to allow for transient and non-persistent object updating in derivative classes
Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setCheckbox(
string $k, boolean $force
=
false
)
:
int | null
Special 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setDefaultProperties(
array $properties
=
array()
)
:
array
Sets 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setPath(
string $path
)
:
void
Set the path of the processor
Inherited from: \modProcessor::setPath()\modObjectProcessor::setPath()Name | Type | Description |
---|---|---|
$path | string | The absolute path |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperties(
array $properties
)
:
void
Set 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperty(
string $k, mixed $v
)
:
void
Set a property value
Inherited from: \modProcessor::setProperty()\modObjectProcessor::setProperty()Name | Type | Description |
---|---|---|
$k | string | |
$v | mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
success(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return a success message from the processor.
Inherited from: \modProcessor::success()\modObjectProcessor::success()Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
toJSON(
mixed $data
)
:
string
Converts 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
unsetProperty(
string $key
)
:
void
Completely 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
__construct(
\modX $modx, array $properties
=
array()
)
:
void
Creates a modProcessor object.
Name | Type | Description |
---|---|---|
$modx | \modX | A reference to the modX instance |
$properties | array | An array of properties |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_decodeLiterals(
string $string
)
:
string
Decodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
_encodeLiterals(
mixed $value, integer | string $key
)
:
void
Encodes 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
addFieldError(
string $key, string $message
=
''
)
:
mixed
Add an error to the field
Name | Type | Description |
---|---|---|
$key | string | |
$message | string |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
checkPermissions(
)
:
boolean
Return true here to allow access to this processor.
Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
failure(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return a failure message from the processor.
Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getInstance(
\modX $modx, string $className, array $properties
=
array()
)
:
\The
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getLanguageTopics(
)
:
array
Load 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperties(
)
:
array
Get an array of properties for this processor
Type | Description |
---|---|
array |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getProperty(
string $k, mixed $default
=
null
)
:
mixed
Get a specific property.
Name | Type | Description |
---|---|---|
$k | string | |
$default | mixed |
Type | Description |
---|---|
mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
hasErrors(
)
:
boolean
Return whether or not the processor has errors
Type | Description |
---|---|
boolean |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
initialize(
)
:
boolean
Can 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
outputArray(
array $array, mixed $count
=
false
)
:
string
Return 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
process(
)
:
mixed
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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
string
Processes 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. |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
run(
)
:
\modProcessorResponse
Run the processor, returning a modProcessorResponse object.
Type | Description |
---|---|
\modProcessorResponse |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setCheckbox(
string $k, boolean $force
=
false
)
:
int | null
Special 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setDefaultProperties(
array $properties
=
array()
)
:
array
Sets 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 |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setPath(
string $path
)
:
void
Set the path of the processor
Name | Type | Description |
---|---|---|
$path | string | The absolute path |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperties(
array $properties
)
:
void
Set the runtime properties for the processor
Name | Type | Description |
---|---|---|
$properties | array | The properties, in array and key-value form, to run on this processor |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
setProperty(
string $k, mixed $v
)
:
void
Set a property value
Name | Type | Description |
---|---|---|
$k | string | |
$v | mixed |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
success(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return a success message from the processor.
Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
toJSON(
mixed $data
)
:
string
Converts 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
![](images/icons/arrow_right.png)
![Property](images/icons/property.png)
array
$errors= 'array()'
array()
Details- Type
- array
Methods
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
__construct(
\modX $modx, array $response
=
array()
)
:
void
The constructor for modProcessorResponse
Name | Type | Description |
---|---|---|
$modx | \modX | A reference to the modX object. |
$response | array | The array response from the modX.runProcessor method |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getAllErrors(
string $fieldErrorSeparator
=
': '
)
:
array
Gets 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. |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getErrorType(
)
:
string
Returns the type of error for this response
Type | Description |
---|---|
string | The type of error returned |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getFieldErrors(
)
:
array
An array of modProcessorResponseError objects for each field-specific error
Type | Description |
---|---|
array |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getMessage(
)
:
string
Gets the general status message for the response.
Type | Description |
---|---|
string | The status message |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getObject(
)
:
array
Returns the array object, if is sent in the response
Type | Description |
---|---|
array | The object in the response, usually the object being performed on. |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getResponse(
)
:
array
Returns the entire response object in array form
Type | Description |
---|---|
array | The array response |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
hasFieldErrors(
)
:
boolean
Checks to see if there are any field-specific errors in this response
Type | Description |
---|---|
boolean | True if there were field-specific errors |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
hasMessage(
)
:
boolean
Returns true if there is a general status message for the response.
Type | Description |
---|---|
boolean | True if there is a general message |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
hasObject(
)
:
boolean
Returns 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
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
__construct(
array $error
=
array()
)
:
void
The constructor for the modProcessorResponseError class
Name | Type | Description |
---|---|---|
$error | array | An array error response |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getError(
)
:
array
Returns the array data for the field-specific error
Type | Description |
---|---|
array |
![](images/icons/arrow_right.png)
![method](images/icons/method.png)
getField(
)
:
string
Returns the field key for the field-specific error
Type | Description |
---|---|
string |