core/model/modx/processors/system/action/create.class.php

Show: inherited
Table of Contents

Create an action

Package
modx  
$controller
string

The controller location

$loadheaders
boolean

Whether or not to load header templates for the action

$namespace
string

The namespace for the action

$lang_topics
string

The lexicon topics for the action

$assets
string
$parent
integer

(optional) The parent for the action. Defaults to 0.

Subpackage
processors.system.action  

\modActionCreateProcessor

Package: modx\processors\system\action

Create an action

{@inheritdoc}

Parent(s)
\modObjectCreateProcessor < \modObjectProcessor < \modProcessor
$controller
string

The controller location

$loadheaders
boolean

Whether or not to load header templates for the action

$namespace
string

The namespace for the action

$lang_topics
string

The lexicon topics for the action

$assets
string
$parent
integer

(optional) The parent for the action. Defaults to 0.

Properties

Propertypublicstring  $afterSaveEvent= ''''
inherited

The name of the event to fire after savingInherited from: \modObjectCreateProcessor::$$afterSaveEvent
Default value''Details
Type
string
Inherited_from
\modObjectCreateProcessor::$$afterSaveEvent  
Propertypublicstring  $beforeSaveEvent= ''''
inherited

The name of the event to fire before savingInherited from: \modObjectCreateProcessor::$$beforeSaveEvent
Default value''Details
Type
string
Inherited_from
\modObjectCreateProcessor::$$beforeSaveEvent  
Propertypublicstring  $classKey= ''modAction''

The class key of the Object to iterate
Default value'modAction'Details
Type
string
Propertypublic  $elementType= ''action''
Default value'action'Details
Type
n/a
Propertypublicarray  $languageTopics= 'array('action','menu','namespace')'

An array of language topics to load
Default valuearray('action','menu','namespace')Details
Type
array
Propertypublic\modX  $modx= 'null'
inherited

A reference to the modX object.

Inherited from: \modProcessor::$$modx\modObjectProcessor::$$modx\modObjectCreateProcessor::$$modx
Default valuenullDetails
Type
\modX
Inherited_from
\modProcessor::$$modx  
Inherited_from
\modObjectProcessor::$$modx  
Inherited_from
\modObjectCreateProcessor::$$modx  
Propertypublic\xPDOObject|\modAccessibleObject  $object= ''
inherited

The object being grabbedInherited from: \modObjectProcessor::$$object\modObjectCreateProcessor::$$object
Propertypublicstring  $objectType= ''object''
inherited

The object "type", this will be used in various lexicon error stringsInherited from: \modObjectProcessor::$$objectType\modObjectCreateProcessor::$$objectType
Default value'object'Details
Type
string
Inherited_from
\modObjectProcessor::$$objectType  
Inherited_from
\modObjectCreateProcessor::$$objectType  
Propertypublicstring  $path= ''''
inherited

The absolute path to this processor

Inherited from: \modProcessor::$$path\modObjectProcessor::$$path\modObjectCreateProcessor::$$path
Default value''Details
Type
string
Inherited_from
\modProcessor::$$path  
Inherited_from
\modObjectProcessor::$$path  
Inherited_from
\modObjectCreateProcessor::$$path  
Propertypublicstring  $permission= ''actions''

The Permission to use when checking against
Default value'actions'Details
Type
string
Propertypublicstring  $primaryKeyField= ''id''
inherited

The primary key field to grab the object byInherited from: \modObjectProcessor::$$primaryKeyField\modObjectCreateProcessor::$$primaryKeyField
Default value'id'Details
Type
string
Inherited_from
\modObjectProcessor::$$primaryKeyField  
Inherited_from
\modObjectCreateProcessor::$$primaryKeyField  
Propertypublicarray  $properties= 'array()'
inherited

The array of properties being passed to this processor

Inherited from: \modProcessor::$$properties\modObjectProcessor::$$properties\modObjectCreateProcessor::$$properties
Default valuearray()Details
Type
array
Inherited_from
\modProcessor::$$properties  
Inherited_from
\modObjectProcessor::$$properties  
Inherited_from
\modObjectCreateProcessor::$$properties  

Methods

methodpublic__construct( \modX $modx, array $properties = array() ) : void
Parameters
Name Type Description
$modx \modX

A reference to the modX instance

$properties array

An array of properties

methodprotected_decodeLiterals( string $string ) : string
inherited

Decodes strings encoded by _encodeLiterals to restore JavaScript literals.

Inherited from: \modProcessor::_decodeLiterals()\modObjectProcessor::_decodeLiterals()\modObjectCreateProcessor::_decodeLiterals()
Parameters
Name Type Description
$string string

The JSON-encoded string with encoded literals.

Returns
Type Description
string The JSON-encoded string with literals restored.
Details
Access
protected  
methodprotected_encodeLiterals( mixed $value, integer | string $key ) : void
inherited

Encodes certain JavaScript literal strings for later decoding.

Inherited from: \modProcessor::_encodeLiterals()\modObjectProcessor::_encodeLiterals()\modObjectCreateProcessor::_encodeLiterals()
Parameters
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.

Details
Access
protected  
methodpublicaddFieldError( string $key, string $message = '' ) : mixed
Parameters
Name Type Description
$key string
$message string
Returns
Type Description
mixed
methodpublicafterSave( ) : boolean
inherited

Override in your derivative class to do functionality before save() is run

Inherited from: \modObjectCreateProcessor::afterSave()
Returns
Type Description
boolean
methodpublicbeforeSave( ) : boolean

Override in your derivative class to do functionality after save() is run

Returns
Type Description
boolean
methodpublicbeforeSet( ) : boolean
inherited

Override in your derivative class to do functionality before the fields are set on the object

Inherited from: \modObjectCreateProcessor::beforeSet()
Returns
Type Description
boolean
methodpubliccheckPermissions( ) : boolean
inherited

Return true here to allow access to this processor.

Inherited from: \modObjectProcessor::checkPermissions()\modObjectCreateProcessor::checkPermissions()
Returns
Type Description
boolean
methodpubliccleanup( ) : array
inherited

Return the success message

Inherited from: \modObjectCreateProcessor::cleanup()
Returns
Type Description
array
methodpublicdoesAlreadyExist( array $criteria ) : int
Parameters
Name Type Description
$criteria array
Returns
Type Description
int
methodpublicfailure( string $msg = '', mixed $object = null ) : array | string
inherited

Return a failure message from the processor.

Inherited from: \modProcessor::failure()\modObjectProcessor::failure()\modObjectCreateProcessor::failure()
Parameters
Name Type Description
$msg string
$object mixed
Returns
Type Description
array | string
methodpublicfireAfterSaveEvent( ) : void
inherited

Fire the after save event

Inherited from: \modObjectCreateProcessor::fireAfterSaveEvent()
methodpublicfireBeforeSaveEvent( ) : boolean
inherited

Fire before save event. Return true to prevent saving.

Inherited from: \modObjectCreateProcessor::fireBeforeSaveEvent()
Returns
Type Description
boolean
methodpublicgetInstance( \modX $modx, string $className, array $properties = array() ) : \The
staticinherited

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()\modObjectCreateProcessor::getInstance()
Parameters
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

Returns
Type Description
\The class specified by $className
Details
Static
 
methodpublicgetLanguageTopics( ) : array
inherited

Load a collection of Language Topics for this processor.

Inherited from: \modObjectProcessor::getLanguageTopics()\modObjectCreateProcessor::getLanguageTopics()

Override this in your derivative class to provide the array of topics to load.

Returns
Type Description
array
methodpublicgetProperties( ) : array
inherited

Get an array of properties for this processor

Inherited from: \modProcessor::getProperties()\modObjectProcessor::getProperties()\modObjectCreateProcessor::getProperties()
Returns
Type Description
array
methodpublicgetProperty( string $k, mixed $default = null ) : mixed
Parameters
Name Type Description
$k string
$default mixed
Returns
Type Description
mixed
methodpublichasErrors( ) : boolean
inherited

Return whether or not the processor has errors

Inherited from: \modProcessor::hasErrors()\modObjectProcessor::hasErrors()\modObjectCreateProcessor::hasErrors()
Returns
Type Description
boolean
methodpublicinitialize( ) : 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.

Returns
Type Description
boolean
methodpubliclogManagerAction( ) : void
inherited

Log the removal manager action

Inherited from: \modObjectCreateProcessor::logManagerAction()
methodpublicoutputArray( array $array, mixed $count = false ) : string
inherited

Return arrays of objects (with count) converted to JSON.

Inherited from: \modProcessor::outputArray()\modObjectProcessor::outputArray()\modObjectCreateProcessor::outputArray()

The JSON result includes two main elements, total and results. This format is used for list results.

Parameters
Name Type Description
$array array

An array of data objects.

$count mixed

The total number of objects. Used for pagination.

Returns
Type Description
string The JSON output.
Details
Access
public  
methodpublicprocess( ) : mixed
inherited

Process the Object create processor Run the processor and return the result. Override this in your derivative class to provide custom functionality.

Inherited from: \modObjectCreateProcessor::process()

Used here for pre-2.2-style processors.

Returns
Type Description
mixed
methodpublicprocessEventResponse( array | string $response, string $separator = "\n" ) : string
Parameters
Name Type Description
$response array | string

The response generated by the invokeEvent call

$separator string

The separator for each event response

Returns
Type Description
string The processed response.
methodpublicrun( ) : \modProcessorResponse
inherited

Run the processor, returning a modProcessorResponse object.

Inherited from: \modProcessor::run()\modObjectProcessor::run()\modObjectCreateProcessor::run()
Returns
Type Description
\modProcessorResponse
methodpublicsetCheckbox( string $k, boolean $force = false ) : int | null
inherited

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()\modObjectCreateProcessor::setCheckbox()
Parameters
Name Type Description
$k string
$force boolean
Returns
Type Description
int | null
methodpublicsetDefaultProperties( array $properties = array() ) : array
inherited

Sets default properties that only are set if they don't already exist in the request

Inherited from: \modProcessor::setDefaultProperties()\modObjectProcessor::setDefaultProperties()\modObjectCreateProcessor::setDefaultProperties()
Parameters
Name Type Description
$properties array
Returns
Type Description
array The newly merged properties array
methodpublicsetPath( string $path ) : void
Parameters
Name Type Description
$path string

The absolute path

methodpublicsetProperties( array $properties ) : void
inherited

Set the runtime properties for the processor

Inherited from: \modProcessor::setProperties()\modObjectProcessor::setProperties()\modObjectCreateProcessor::setProperties()
Parameters
Name Type Description
$properties array

The properties, in array and key-value form, to run on this processor

methodpublicsetProperty( string $k, mixed $v ) : void
Parameters
Name Type Description
$k string
$v mixed
methodpublicsuccess( string $msg = '', mixed $object = null ) : array | string
inherited

Return a success message from the processor.

Inherited from: \modProcessor::success()\modObjectProcessor::success()\modObjectCreateProcessor::success()
Parameters
Name Type Description
$msg string
$object mixed
Returns
Type Description
array | string
methodpublictoJSON( mixed $data ) : string
inherited

Converts PHP to JSON with JavaScript literals left in-tact.

Inherited from: \modProcessor::toJSON()\modObjectProcessor::toJSON()\modObjectCreateProcessor::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.

Parameters
Name Type Description
$data mixed

The PHP data to be converted.

Returns
Type Description
string The extended JSON-encoded string.
Details
Access
public  
methodpublicunsetProperty( string $key ) : void
inherited

Completely unset a property from the properties array

Inherited from: \modProcessor::unsetProperty()\modObjectProcessor::unsetProperty()\modObjectCreateProcessor::unsetProperty()
Parameters
Name Type Description
$key string
Documentation was generated by DocBlox 0.18.1.