core/model/modx/processors/system/settings/update.class.php
Update a system setting
- Package
- modx
- $key
- string
The key of the setting
- $value
- string
The value of the setting
- $xtype
- string
The xtype for the setting, for rendering purposes
- $area
- string
The area for the setting
- $namespace
- string
The namespace for the setting
- $name
- string
The lexicon name for the setting
- $description
- string
The lexicon description for the setting
- Subpackage
- processors.system.settings
\modSystemSettingsUpdateProcessor
Update a system setting
{@inheritdoc}
- Parent(s)
- \modObjectUpdateProcessor < \modObjectProcessor < \modProcessor
- Children
- \modSystemSettingsUpdateFromGridProcessor
- $key
- string
The key of the setting
- $value
- string
The value of the setting
- $xtype
- string
The xtype for the setting, for rendering purposes
- $area
- string
The area for the setting
- $namespace
- string
The namespace for the setting
- $name
- string
The lexicon name for the setting
- $description
- string
The lexicon description for the setting
Properties

string
$afterSaveEvent= ''''
''Details- Type
- string
- Inherited_from
- \modObjectUpdateProcessor::$$afterSaveEvent

string
$beforeSaveEvent= ''''
''Details- Type
- string
- Inherited_from
- \modObjectUpdateProcessor::$$beforeSaveEvent

$checkSavePermission= 'true'
trueDetails- Type
- n/a
- Inherited_from
- \modObjectUpdateProcessor::$$checkSavePermission

string
$classKey= ''modSystemSetting''
'modSystemSetting'Details- Type
- string

array
$languageTopics= 'array('setting','namespace')'
array('setting','namespace')Details- Type
- array

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

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

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

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

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

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

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

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

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

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

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

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

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

checkForBooleanValue(
)
:
mixedIf this is a Boolean setting, ensure the value of the setting is 1/0
| Type | Description |
|---|---|
| mixed |

checkForRefreshURIs(
)
:
booleanCheck to see if the URIs need to be refreshed
| Type | Description |
|---|---|
| boolean |

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

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

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

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

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

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

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

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

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

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

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

processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
stringProcesses a response from a Plugin Event invocation
Inherited from: \modProcessor::processEventResponse()\modObjectProcessor::processEventResponse()\modObjectUpdateProcessor::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. |

refreshURIs(
)
:
booleanIf friendly_urls is set on or use_alias_path changes, refreshURIs
| Type | Description |
|---|---|
| boolean |

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

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

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

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

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

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

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

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

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

unsetProperty(
string $key
)
:
voidCompletely unset a property from the properties array
Inherited from: \modProcessor::unsetProperty()\modObjectProcessor::unsetProperty()\modObjectUpdateProcessor::unsetProperty()| Name | Type | Description |
|---|---|---|
| $key | string |

updateTranslations(
array $fields
)
:
voidUpdate lexicon name/description
| Name | Type | Description |
|---|---|---|
| $fields | array |