core/model/modx/processors/element/chunk/getlist.class.php
Grabs a list of chunks.
- Package
- modx
- $start
- integer
(optional) The record to start at. Defaults to 0.
- $limit
- integer
(optional) The number of records to limit to. Defaults to 10.
- $sort
- string
(optional) The column to sort by. Defaults to name.
- $dir
- string
(optional) The direction of the sort. Defaults to ASC.
- Subpackage
- processors.element.chunk
\modChunkGetListProcessor
Grabs a list of chunks.
{@inheritdoc}
- Parent(s)
- \modElementGetListProcessor < \modObjectGetListProcessor < \modObjectProcessor < \modProcessor
- $start
- integer
(optional) The record to start at. Defaults to 0.
- $limit
- integer
(optional) The number of records to limit to. Defaults to 10.
- $sort
- string
(optional) The column to sort by. Defaults to name.
- $dir
- string
(optional) The direction of the sort. Defaults to ASC.
Properties
boolean
$checkListPermission= 'true'
true
Details- Type
- boolean
- Inherited_from
- \modObjectGetListProcessor::$$checkListPermission
- Inherited_from
- \modElementGetListProcessor::$$checkListPermission
string
$classKey= ''modChunk''
'modChunk'
Details- Type
- string
int
$currentIndex= '0'
0
Details- Type
- int
- Inherited_from
- \modObjectGetListProcessor::$$currentIndex
- Inherited_from
- \modElementGetListProcessor::$$currentIndex
string
$defaultSortDirection= ''ASC''
'ASC'
Details- Type
- string
- Inherited_from
- \modObjectGetListProcessor::$$defaultSortDirection
- Inherited_from
- \modElementGetListProcessor::$$defaultSortDirection
string
$defaultSortField= ''name''
'name'
Details- Type
- string
- Inherited_from
- \modObjectGetListProcessor::$$defaultSortField
- Inherited_from
- \modElementGetListProcessor::$$defaultSortField
array
$languageTopics= 'array('chunk','category')'
array('chunk','category')
Details- Type
- array
\modX
$modx= 'null'
A reference to the modX object.
Inherited from: \modProcessor::$$modx\modObjectProcessor::$$modx\modObjectGetListProcessor::$$modx\modElementGetListProcessor::$$modxnull
Details- Type
- \modX
- Inherited_from
- \modProcessor::$$modx
- Inherited_from
- \modObjectProcessor::$$modx
- Inherited_from
- \modObjectGetListProcessor::$$modx
- Inherited_from
- \modElementGetListProcessor::$$modx
\xPDOObject|\modAccessibleObject
$object= ''
- Type
- \xPDOObject | \modAccessibleObject
- Inherited_from
- \modObjectProcessor::$$object
- Inherited_from
- \modObjectGetListProcessor::$$object
- Inherited_from
- \modElementGetListProcessor::$$object
string
$objectType= ''object''
'object'
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$objectType
- Inherited_from
- \modObjectGetListProcessor::$$objectType
- Inherited_from
- \modElementGetListProcessor::$$objectType
string
$path= ''''
The absolute path to this processor
Inherited from: \modProcessor::$$path\modObjectProcessor::$$path\modObjectGetListProcessor::$$path\modElementGetListProcessor::$$path''
Details- Type
- string
- Inherited_from
- \modProcessor::$$path
- Inherited_from
- \modObjectProcessor::$$path
- Inherited_from
- \modObjectGetListProcessor::$$path
- Inherited_from
- \modElementGetListProcessor::$$path
string
$permission= ''''
''
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$permission
- Inherited_from
- \modObjectGetListProcessor::$$permission
- Inherited_from
- \modElementGetListProcessor::$$permission
string
$primaryKeyField= ''id''
'id'
Details- Type
- string
- Inherited_from
- \modObjectProcessor::$$primaryKeyField
- Inherited_from
- \modObjectGetListProcessor::$$primaryKeyField
- Inherited_from
- \modElementGetListProcessor::$$primaryKeyField
array
$properties= 'array()'
The array of properties being passed to this processor
Inherited from: \modProcessor::$$properties\modObjectProcessor::$$properties\modObjectGetListProcessor::$$properties\modElementGetListProcessor::$$propertiesarray()
Details- Type
- array
- Inherited_from
- \modProcessor::$$properties
- Inherited_from
- \modObjectProcessor::$$properties
- Inherited_from
- \modObjectGetListProcessor::$$properties
- Inherited_from
- \modElementGetListProcessor::$$properties
Methods
__construct(
\modX $modx, array $properties
=
array()
)
:
void
Creates a modProcessor object.
Inherited from: \modProcessor::__construct()\modObjectProcessor::__construct()\modObjectGetListProcessor::__construct()\modElementGetListProcessor::__construct()Name | Type | Description |
---|---|---|
$modx | \modX | A reference to the modX instance |
$properties | array | An array of properties |
_decodeLiterals(
string $string
)
:
string
Decodes strings encoded by _encodeLiterals to restore JavaScript literals.
Inherited from: \modProcessor::_decodeLiterals()\modObjectProcessor::_decodeLiterals()\modObjectGetListProcessor::_decodeLiterals()\modElementGetListProcessor::_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
)
:
void
Encodes certain JavaScript literal strings for later decoding.
Inherited from: \modProcessor::_encodeLiterals()\modObjectProcessor::_encodeLiterals()\modObjectGetListProcessor::_encodeLiterals()\modElementGetListProcessor::_encodeLiterals()Name | Type | Description |
---|---|---|
$value | mixed | &$value A reference to the value to be encoded if it is identified as a literal. |
$key | integer | string | The array key corresponding to the value. |
- Access
- protected
addFieldError(
string $key, string $message
=
''
)
:
mixed
Add an error to the field
Inherited from: \modProcessor::addFieldError()\modObjectProcessor::addFieldError()\modObjectGetListProcessor::addFieldError()\modElementGetListProcessor::addFieldError()Name | Type | Description |
---|---|---|
$key | string | |
$message | string |
Type | Description |
---|---|
mixed |
afterIteration(
array $list
)
:
array
Can be used to insert a row after iteration
Inherited from: \modObjectGetListProcessor::afterIteration()\modElementGetListProcessor::afterIteration()Name | Type | Description |
---|---|---|
$list | array |
Type | Description |
---|---|
array |
beforeIteration(
array $list
)
:
array
Can be used to insert a row before iteration
Inherited from: \modObjectGetListProcessor::beforeIteration()\modElementGetListProcessor::beforeIteration()Name | Type | Description |
---|---|---|
$list | array |
Type | Description |
---|---|
array |
beforeQuery(
)
:
boolean
Allow stoppage of process before the query
Inherited from: \modObjectGetListProcessor::beforeQuery()\modElementGetListProcessor::beforeQuery()Type | Description |
---|---|
boolean |
checkPermissions(
)
:
boolean
Return true here to allow access to this processor.
Inherited from: \modObjectProcessor::checkPermissions()\modObjectGetListProcessor::checkPermissions()\modElementGetListProcessor::checkPermissions()Type | Description |
---|---|
boolean |
failure(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return a failure message from the processor.
Inherited from: \modProcessor::failure()\modObjectProcessor::failure()\modObjectGetListProcessor::failure()\modElementGetListProcessor::failure()Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
getData(
)
:
array
Get the data of the query
Inherited from: \modObjectGetListProcessor::getData()\modElementGetListProcessor::getData()Type | Description |
---|---|
array |
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()\modObjectGetListProcessor::getInstance()\modElementGetListProcessor::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(
)
:
array
Load a collection of Language Topics for this processor.
Inherited from: \modObjectProcessor::getLanguageTopics()\modObjectGetListProcessor::getLanguageTopics()\modElementGetListProcessor::getLanguageTopics()Override this in your derivative class to provide the array of topics to load.
Type | Description |
---|---|
array |
getProperties(
)
:
array
Get an array of properties for this processor
Inherited from: \modProcessor::getProperties()\modObjectProcessor::getProperties()\modObjectGetListProcessor::getProperties()\modElementGetListProcessor::getProperties()Type | Description |
---|---|
array |
getProperty(
string $k, mixed $default
=
null
)
:
mixed
Get a specific property.
Inherited from: \modProcessor::getProperty()\modObjectProcessor::getProperty()\modObjectGetListProcessor::getProperty()\modElementGetListProcessor::getProperty()Name | Type | Description |
---|---|---|
$k | string | |
$default | mixed |
Type | Description |
---|---|
mixed |
getSortClassKey(
)
:
string
Can be used to provide a custom sorting class key for the default sorting columns
Inherited from: \modObjectGetListProcessor::getSortClassKey()\modElementGetListProcessor::getSortClassKey()Type | Description |
---|---|
string |
hasErrors(
)
:
boolean
Return whether or not the processor has errors
Inherited from: \modProcessor::hasErrors()\modObjectProcessor::hasErrors()\modObjectGetListProcessor::hasErrors()\modElementGetListProcessor::hasErrors()Type | Description |
---|---|
boolean |
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: \modObjectGetListProcessor::initialize()\modElementGetListProcessor::initialize()Type | Description |
---|---|
boolean |
iterate(
array $data
)
:
array
Iterate across the data
Inherited from: \modObjectGetListProcessor::iterate()\modElementGetListProcessor::iterate()Name | Type | Description |
---|---|---|
$data | array |
Type | Description |
---|---|
array |
outputArray(
array $array, mixed $count
=
false
)
:
string
Return arrays of objects (with count) converted to JSON.
Inherited from: \modProcessor::outputArray()\modObjectProcessor::outputArray()\modObjectGetListProcessor::outputArray()\modElementGetListProcessor::outputArray()The JSON result includes two main elements, total and results. This format is used for list results.
Name | Type | Description |
---|---|---|
$array | array | An array of data objects. |
$count | mixed | The total number of objects. Used for pagination. |
Type | Description |
---|---|
string | The JSON output. |
- Access
- public
prepareQueryAfterCount(
\xPDOQuery $c
)
:
\xPDOQuery
Can be used to prepare the query after the COUNT statement
Inherited from: \modElementGetListProcessor::prepareQueryAfterCount()Name | Type | Description |
---|---|---|
$c | \xPDOQuery |
Type | Description |
---|---|
\xPDOQuery |
prepareQueryBeforeCount(
\xPDOQuery $c
)
:
\xPDOQuery
Can be used to adjust the query prior to the COUNT statement
Inherited from: \modElementGetListProcessor::prepareQueryBeforeCount()Name | Type | Description |
---|---|---|
$c | \xPDOQuery |
Type | Description |
---|---|
\xPDOQuery |
prepareRow(
\xPDOObject $object
)
:
array
Prepare the row for iteration
Inherited from: \modObjectGetListProcessor::prepareRow()\modElementGetListProcessor::prepareRow()Name | Type | Description |
---|---|---|
$object | \xPDOObject |
Type | Description |
---|---|
array |
process(
)
:
mixed
Run the processor and return the result. Override this in your derivative class to provide custom functionality.
Inherited from: \modObjectGetListProcessor::process()\modElementGetListProcessor::process()Used here for pre-2.2-style processors.
Type | Description |
---|---|
mixed |
processEventResponse(
array | string $response, string $separator
=
"\n"
)
:
string
Processes a response from a Plugin Event invocation
Inherited from: \modProcessor::processEventResponse()\modObjectProcessor::processEventResponse()\modObjectGetListProcessor::processEventResponse()\modElementGetListProcessor::processEventResponse()Name | Type | Description |
---|---|---|
$response | array | string | The response generated by the invokeEvent call |
$separator | string | The separator for each event response |
Type | Description |
---|---|
string | The processed response. |
run(
)
:
\modProcessorResponse
Run the processor, returning a modProcessorResponse object.
Inherited from: \modProcessor::run()\modObjectProcessor::run()\modObjectGetListProcessor::run()\modElementGetListProcessor::run()Type | Description |
---|---|
\modProcessorResponse |
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()\modObjectGetListProcessor::setCheckbox()\modElementGetListProcessor::setCheckbox()Name | Type | Description |
---|---|---|
$k | string | |
$force | boolean |
Type | Description |
---|---|
int | null |
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()\modObjectGetListProcessor::setDefaultProperties()\modElementGetListProcessor::setDefaultProperties()Name | Type | Description |
---|---|---|
$properties | array |
Type | Description |
---|---|
array | The newly merged properties array |
setPath(
string $path
)
:
void
Set the path of the processor
Inherited from: \modProcessor::setPath()\modObjectProcessor::setPath()\modObjectGetListProcessor::setPath()\modElementGetListProcessor::setPath()Name | Type | Description |
---|---|---|
$path | string | The absolute path |
setProperties(
array $properties
)
:
void
Set the runtime properties for the processor
Inherited from: \modProcessor::setProperties()\modObjectProcessor::setProperties()\modObjectGetListProcessor::setProperties()\modElementGetListProcessor::setProperties()Name | Type | Description |
---|---|---|
$properties | array | The properties, in array and key-value form, to run on this processor |
setProperty(
string $k, mixed $v
)
:
void
Set a property value
Inherited from: \modProcessor::setProperty()\modObjectProcessor::setProperty()\modObjectGetListProcessor::setProperty()\modElementGetListProcessor::setProperty()Name | Type | Description |
---|---|---|
$k | string | |
$v | mixed |
success(
string $msg
=
'', mixed $object
=
null
)
:
array | string
Return a success message from the processor.
Inherited from: \modProcessor::success()\modObjectProcessor::success()\modObjectGetListProcessor::success()\modElementGetListProcessor::success()Name | Type | Description |
---|---|---|
$msg | string | |
$object | mixed |
Type | Description |
---|---|
array | string |
toJSON(
mixed $data
)
:
string
Converts PHP to JSON with JavaScript literals left in-tact.
Inherited from: \modProcessor::toJSON()\modObjectProcessor::toJSON()\modObjectGetListProcessor::toJSON()\modElementGetListProcessor::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
)
:
void
Completely unset a property from the properties array
Inherited from: \modProcessor::unsetProperty()\modObjectProcessor::unsetProperty()\modObjectGetListProcessor::unsetProperty()\modElementGetListProcessor::unsetProperty()Name | Type | Description |
---|---|---|
$key | string |