class cApiClickableAction cApiClickableAction is a subclass of cApiAction.

It provides an image for visual representation. Inherited classes should call the "setNamedAction" operation in their constructors; on-the-fly-implementations should call it directly after creating an object instance.

package CONTENIDO API
copyright four for business AG

 Methods

Constructor function for downwards compatibility

Item($sTable, $sPrimaryKey, $iLifetime) 
Inherited
inherited_from \Item::Item()
inherited_from \cApiAction::Item()
inherited_from \cApiClickableAction::Item()

Parameters

$sTable

$sPrimaryKey

$iLifetime

Constructor Function

__construct() : void

Exceptions

\cInvalidArgumentException If table name or primary key is not set

Filters the passed data using the functions defines in the _arrInFilters array.

_inFilter(mixed $mData) : mixed
Inherited
see \setFilters
inherited_from \Item::_inFilter()
inherited_from \cApiAction::_inFilter()
inherited_from \cApiClickableAction::_inFilter()

Parameters

$mData

mixed

Data to filter

Returns

mixedFiltered data

cApiAction()

cApiAction($mId) 
Inherited
inherited_from \cApiAction::cApiAction()
inherited_from \cApiClickableAction::cApiAction()

Parameters

$mId

cApiClickableAction()

cApiClickableAction() 
Inherited
inherited_from \cApiClickableAction::cApiClickableAction()

cApiClickableQuestionAction()

cApiClickableQuestionAction() 
deprecated [2011-03-15] Old constructor function for downwards compatibility

Change linked area

changeArea($sArea) 
Inherited
inherited_from \cApiClickableAction::changeArea()

Parameters

$sArea

Deletes a custom property.

deleteProperty(string $sType, string $sName) : bool
Inherited
inherited_from \Item::deleteProperty()
inherited_from \cApiAction::deleteProperty()
inherited_from \cApiClickableAction::deleteProperty()

Parameters

$sType

string

Specifies the type

$sName

string

Specifies the name

Returns

bool

Deletes a custom property by its id.

deletePropertyById(int $idprop) : bool
Inherited
inherited_from \Item::deletePropertyById()
inherited_from \cApiAction::deletePropertyById()
inherited_from \cApiClickableAction::deletePropertyById()

Parameters

$idprop

int

Id of property

Returns

bool

Escape string for using in SQL-Statement.

escape(string $sString) : string
Inherited
inherited_from \cItemBaseAbstract::escape()
inherited_from \Item::escape()
inherited_from \cApiAction::escape()
inherited_from \cApiClickableAction::escape()

Parameters

$sString

string

The string to escape

Returns

stringEscaped string

Wrapper for getField (less to type).

get(string $sField) : mixed
Inherited
inherited_from \Item::get()
inherited_from \cApiAction::get()
inherited_from \cApiClickableAction::get()

Parameters

$sField

string

Specifies the field to retrieve

Returns

mixedValue of the field

Gets the value of a specific field.

getField(string $sField) : mixed
Inherited
inherited_from \Item::getField()
inherited_from \cApiAction::getField()
inherited_from \cApiClickableAction::getField()

Parameters

$sField

string

Specifies the field to retrieve

Returns

mixedValue of the field

getHelpText()

getHelpText() 
Inherited
inherited_from \cApiClickableAction::getHelpText()

getIcon()

getIcon() 
Inherited
inherited_from \cApiClickableAction::getIcon()

getMetaObject()

getMetaObject() 
Inherited
inherited_from \Item::getMetaObject()
inherited_from \cApiAction::getMetaObject()
inherited_from \cApiClickableAction::getMetaObject()

Returns a custom property.

getProperty(string $sType, string $sName) : mixed
Inherited
inherited_from \Item::getProperty()
inherited_from \cApiAction::getProperty()
inherited_from \cApiClickableAction::getProperty()

Parameters

$sType

string

Specifies the type

$sName

string

Specifies the name

Returns

mixedValue of the given property or false

Checks if a the item is already loaded.

isLoaded() : bool
Inherited
inherited_from \Item::isLoaded()
inherited_from \cApiAction::isLoaded()
inherited_from \cApiClickableAction::isLoaded()

Returns

bool

Loads an item by colum/field from the database.

loadBy(string $sField, mixed $mValue, bool $bSafe) : bool
Inherited
inherited_from \Item::loadBy()
inherited_from \cApiAction::loadBy()
inherited_from \cApiClickableAction::loadBy()

Parameters

$sField

string

Specifies the field

$mValue

mixed

Specifies the value

$bSafe

bool

Use inFilter or not

Exceptions

\cException if more than one item has been found matching the given arguments

Returns

boolTrue if the load was successful

Loads an item by colums/fields from the database.

loadByMany(array $aAttributes, bool $bSafe) : bool
Inherited
inherited_from \Item::loadByMany()
inherited_from \cApiAction::loadByMany()
inherited_from \cApiClickableAction::loadByMany()

Parameters

$aAttributes

array

associative array with field / value pairs

$bSafe

bool

Use inFilter or not

Exceptions

\cException if more than one item could be found matching the given arguments

Returns

boolTrue if the load was successful

Loads an item by ID from the database.

loadByPrimaryKey(string $mValue) : bool
Inherited
inherited_from \Item::loadByPrimaryKey()
inherited_from \cApiAction::loadByPrimaryKey()
inherited_from \cApiClickableAction::loadByPrimaryKey()

Parameters

$mValue

string

Specifies the primary key value

Returns

boolTrue if the load was successful

Loads an item by it's recordset.

loadByRecordSet(array $aRecordSet) 
Inherited
inherited_from \Item::loadByRecordSet()
inherited_from \cApiAction::loadByRecordSet()
inherited_from \cApiClickableAction::loadByRecordSet()

Parameters

$aRecordSet

array

The recordset of the item

process()

process($parameters) 
Inherited
inherited_from \cApiClickableAction::process()

Parameters

$parameters

Registers a new callback.

register(string $event, mixed $callback, mixed $class) : void
InheritedStatic

Example: cGenericDb::register(cGenericDb::CREATE_SUCCESS, 'itemCreateHandler', 'cApiArticle'); cGenericDb::register(cGenericDb::CREATE_SUCCESS, array('cCallbackHandler', 'executeCreateHandle'), 'cApiArticle');

inherited_from \cGenericDb::register()
inherited_from \cItemBaseAbstract::register()
inherited_from \Item::register()
inherited_from \cApiAction::register()
inherited_from \cApiClickableAction::register()

Parameters

$event

string

Callback event, must be a valid value of a cGenericDb event constant

$callback

mixed

Callback to register

$class

mixed

Class name for registering callback (can be string of array with names of the concrete Item classes)

Exceptions

\cInvalidArgumentException if event or class are not set or the callback is not callable

render()

render() 

renderText()

renderText() 
Inherited
inherited_from \cApiClickableAction::renderText()

Shortcut to setField.

set(string $sField, string $mValue, bool $bSafe) 
Inherited
inherited_from \Item::set()
inherited_from \cApiAction::set()
inherited_from \cApiClickableAction::set()

Parameters

$sField

string

Field name

$mValue

string

Value to set

$bSafe

bool

Flag to run defined inFilter on passed value

setDisabled()

setDisabled() 
Inherited
inherited_from \cApiClickableAction::setDisabled()

setEnabled()

setEnabled() 
Inherited
inherited_from \cApiClickableAction::setEnabled()

Sets the value of a specific field.

setField(string $sField, string $mValue, bool $bSafe) 
Inherited
inherited_from \Item::setField()
inherited_from \cApiAction::setField()
inherited_from \cApiClickableAction::setField()

Parameters

$sField

string

Field name

$mValue

string

Value to set

$bSafe

bool

Flag to run defined inFilter on passed value

Define the filter functions used when data is being stored or retrieved from the database.

setFilters(array $aInFilters, array $aOutFilters) : void
Inherited

Examples:

$obj->setFilters(array('addslashes'), array('stripslashes'));
$obj->setFilters(array('htmlencode', 'addslashes'), array('stripslashes', 'htmlencode'));
inherited_from \Item::setFilters()
inherited_from \cApiAction::setFilters()
inherited_from \cApiClickableAction::setFilters()

Parameters

$aInFilters

array

Array with function names

$aOutFilters

array

Array with function names

sets the help text for this action.

setHelpText(string $helptext) : void
Inherited
inherited_from \cApiClickableAction::setHelpText()

Parameters

$helptext

string

helptext The helptext to apply

Sets the action icon for this action.

setIcon(string $icon) : void
Inherited
inherited_from \cApiClickableAction::setIcon()

Parameters

$icon

string

icon Path to the icon. Relative to the backend, if not passed as absolute path.

Sets this class to use a specific action, example "con_makestart".

setNamedAction(string $actionName) : void
Inherited
inherited_from \cApiClickableAction::setNamedAction()

Parameters

$actionName

string

actionName Name of the action to use. This action must exist in the actions table before using it, otherwise, this method will fail.

setParameter()

setParameter($name, $value) 
Inherited
inherited_from \cApiClickableAction::setParameter()

Parameters

$name

$value

Sets a custom property.

setProperty(string $sType, string $sName, mixed $mValue) : bool
Inherited
inherited_from \Item::setProperty()
inherited_from \cApiAction::setProperty()
inherited_from \cApiClickableAction::setProperty()

Parameters

$sType

string

Specifies the type

$sName

string

Specifies the name

$mValue

mixed

Specifies the value

Returns

bool

setQuestion()

setQuestion($question) 

Parameters

$question

setQuestionMode()

setQuestionMode($mode) 

Parameters

$mode

setResultVar()

setResultVar($var) 

Parameters

$var

Stores the loaded and modified item to the database.

store() : bool
Inherited
inherited_from \Item::store()
inherited_from \cApiAction::store()
inherited_from \cApiClickableAction::store()

Returns

bool

Returns current item data as an assoziative array.

toArray() : array | false
Inherited
inherited_from \Item::toArray()
inherited_from \cApiAction::toArray()
inherited_from \cApiClickableAction::toArray()

Returns

arrayfalse

Returns current item data as an object.

toObject() : \stdClass | false
Inherited
inherited_from \Item::toObject()
inherited_from \cApiAction::toObject()
inherited_from \cApiClickableAction::toObject()

Returns

\stdClassfalse

Unregisters all callbacks for a specific event in a class.

unregister(string $event, mixed $class) : void
InheritedStatic

Example: cGenericDb::unregister(cGenericDb::CREATE_SUCCESS, 'cApiArticle');

inherited_from \cGenericDb::unregister()
inherited_from \cItemBaseAbstract::unregister()
inherited_from \Item::unregister()
inherited_from \cApiAction::unregister()
inherited_from \cApiClickableAction::unregister()

Parameters

$event

string

Callback event, must be a valid value of a cGenericDb event constant

$class

mixed

Class name for unregistering callback (can be string of array with names of the concrete Item classes)

Exceptions

\cInvalidArgumentException if the event or the class are not set

wantParameter()

wantParameter($parameter) 
Inherited
inherited_from \cApiClickableAction::wantParameter()

Parameters

$parameter

Executes all callbacks for a specific event in a class.

_executeCallbacks(string $event, string $class, array $arguments) : void
Inherited
inherited_from \cGenericDb::_executeCallbacks()
inherited_from \cItemBaseAbstract::_executeCallbacks()
inherited_from \Item::_executeCallbacks()
inherited_from \cApiAction::_executeCallbacks()
inherited_from \cApiClickableAction::_executeCallbacks()

Parameters

$event

string

Callback event, must be a valid value of a cGenericDb event constant

$class

string

Class name for executing callback

$arguments

array

Arguments to pass to the callback function

Exceptions

\cInvalidArgumentException if the event or class is not set

Returns properties instance, instantiates it if not done before.

_getPropertiesCollectionInstance() : \cApiPropertyCollection
Inherited
inherited_from \cItemBaseAbstract::_getPropertiesCollectionInstance()
inherited_from \Item::_getPropertiesCollectionInstance()
inherited_from \cApiAction::_getPropertiesCollectionInstance()
inherited_from \cApiClickableAction::_getPropertiesCollectionInstance()

Returns

Returns the second database instance, usable to run additional statements without losing current query results.

_getSecondDBInstance() : \cDb
Inherited
inherited_from \cItemBaseAbstract::_getSecondDBInstance()
inherited_from \Item::_getSecondDBInstance()
inherited_from \cApiAction::_getSecondDBInstance()
inherited_from \cApiClickableAction::_getSecondDBInstance()

Returns

Loads an item by passed where clause from the database.

_loadByWhereClause(string $sWhere) : bool
Inherited

This function is expensive, since it executes allways a query to the database to retrieve the primary key, even if the record set is aleady cached. NOTE: Passed value has to be escaped before. This will not be done by this function.

inherited_from \Item::_loadByWhereClause()
inherited_from \cApiAction::_loadByWhereClause()
inherited_from \cApiClickableAction::_loadByWhereClause()

Parameters

$sWhere

string

The where clause like 'idart = 123 AND idlang = 1'

Exceptions

\cException if more than one item could be found matching the given where clause

Returns

boolTrue if the load was successful

_onDisable()

_onDisable() 
Inherited
inherited_from \cApiClickableAction::_onDisable()

_onEnable()

_onEnable() 
Inherited
inherited_from \cApiClickableAction::_onEnable()

Function which is called whenever an item is loaded.

_onLoad() : void
Inherited

Inherited classes should override this function if desired.

inherited_from \Item::_onLoad()
inherited_from \cApiAction::_onLoad()
inherited_from \cApiClickableAction::_onLoad()

Filters the passed data using the functions defines in the _arrOutFilters array.

_outFilter(mixed $mData) : mixed
Inherited
see \setFilters
inherited_from \Item::_outFilter()
inherited_from \cApiAction::_outFilter()
inherited_from \cApiClickableAction::_outFilter()

Parameters

$mData

mixed

Data to filter

Returns

mixedFiltered data

_setMetaObject()

_setMetaObject($sObjectName) 
Inherited
inherited_from \Item::_setMetaObject()
inherited_from \cApiAction::_setMetaObject()
inherited_from \cApiClickableAction::_setMetaObject()

Parameters

$sObjectName

 Properties

 

$primaryKey : string
Inherited
inherited_from \cItemBaseAbstract::$$primaryKey
inherited_from \Item::$$primaryKey
inherited_from \cApiAction::$$primaryKey
inherited_from \cApiClickableAction::$$primaryKey
 

$values : array
Inherited
inherited_from \Item::$$values
inherited_from \cApiAction::$$values
inherited_from \cApiClickableAction::$$values
 

$virgin : bool
Inherited

If true, the object is virgin and no operations on it except load-Functions are allowed.

inherited_from \cItemBaseAbstract::$$virgin
inherited_from \Item::$$virgin
inherited_from \cApiAction::$$virgin
inherited_from \cApiClickableAction::$$virgin
 

$_arrInFilters : array
Inherited
inherited_from \Item::$$_arrInFilters
inherited_from \cApiAction::$$_arrInFilters
inherited_from \cApiClickableAction::$$_arrInFilters
 

$_arrOutFilters : array
Inherited
inherited_from \Item::$$_arrOutFilters
inherited_from \cApiAction::$$_arrOutFilters
inherited_from \cApiClickableAction::$$_arrOutFilters
 

$_className : string
Inherited
inherited_from \cItemBaseAbstract::$$_className
inherited_from \Item::$$_className
inherited_from \cApiAction::$$_className
inherited_from \cApiClickableAction::$$_className
 

$_metaObject : string
Inherited
inherited_from \Item::$$_metaObject
inherited_from \cApiAction::$$_metaObject
inherited_from \cApiClickableAction::$$_metaObject
 

$_oCache : \cItemCache
Inherited
inherited_from \cItemBaseAbstract::$$_oCache
inherited_from \Item::$$_oCache
inherited_from \cApiAction::$$_oCache
inherited_from \cApiClickableAction::$$_oCache
 

$_objectInvalid : bool
Inherited
inherited_from \cApiAction::$$_objectInvalid
inherited_from \cApiClickableAction::$$_objectInvalid
 

$_settings : array
Inherited
inherited_from \cItemBaseAbstract::$$_settings
inherited_from \Item::$$_settings
inherited_from \cApiAction::$$_settings
inherited_from \cApiClickableAction::$$_settings
 

$cache : array
Inherited
inherited_from \cItemBaseAbstract::$$cache
inherited_from \Item::$$cache
inherited_from \cApiAction::$$cache
inherited_from \cApiClickableAction::$$cache
 

$db : \cDb
Inherited
inherited_from \cItemBaseAbstract::$$db
inherited_from \Item::$$db
inherited_from \cApiAction::$$db
inherited_from \cApiClickableAction::$$db
 

$lasterror : string
Inherited
inherited_from \cItemBaseAbstract::$$lasterror
inherited_from \Item::$$lasterror
inherited_from \cApiAction::$$lasterror
inherited_from \cApiClickableAction::$$lasterror
 

$lifetime : int
Inherited
inherited_from \cItemBaseAbstract::$$lifetime
inherited_from \Item::$$lifetime
inherited_from \cApiAction::$$lifetime
inherited_from \cApiClickableAction::$$lifetime
 

$modifiedValues : array
Inherited
inherited_from \Item::$$modifiedValues
inherited_from \cApiAction::$$modifiedValues
inherited_from \cApiClickableAction::$$modifiedValues
 

$oldPrimaryKey : string
Inherited
inherited_from \Item::$$oldPrimaryKey
inherited_from \cApiAction::$$oldPrimaryKey
inherited_from \cApiClickableAction::$$oldPrimaryKey
 

$properties : \cApiPropertyCollection
Inherited
inherited_from \cItemBaseAbstract::$$properties
inherited_from \Item::$$properties
inherited_from \cApiAction::$$properties
inherited_from \cApiClickableAction::$$properties
 

$secondDb : \cDb
Inherited
inherited_from \cItemBaseAbstract::$$secondDb
inherited_from \Item::$$secondDb
inherited_from \cApiAction::$$secondDb
inherited_from \cApiClickableAction::$$secondDb
 

$table : string
Inherited
inherited_from \cItemBaseAbstract::$$table
inherited_from \Item::$$table
inherited_from \cApiAction::$$table
inherited_from \cApiClickableAction::$$table
 

$_callbacks : array
Inherited
inherited_from \cGenericDb::$$_callbacks
inherited_from \cItemBaseAbstract::$$_callbacks
inherited_from \Item::$$_callbacks
inherited_from \cApiAction::$$_callbacks
inherited_from \cApiClickableAction::$$_callbacks
 

$_helpText 
Inherited
access private
inherited_from \cApiClickableAction::$$_helpText
 

$_img 
Inherited
access private
inherited_from \cApiClickableAction::$$_img
 

 Constants

 

Callbacks are executed before a item is created.

CREATE_BEFORE 
Inherited

Expected parameters for callback: none

inherited_from \cGenericDb::CREATE_BEFORE
inherited_from \cItemBaseAbstract::CREATE_BEFORE
inherited_from \Item::CREATE_BEFORE
inherited_from \cApiAction::CREATE_BEFORE
inherited_from \cApiClickableAction::CREATE_BEFORE
 

Callbacks are executed if item could not be created.

CREATE_FAILURE 
Inherited

Expected parameters for callback: none

inherited_from \cGenericDb::CREATE_FAILURE
inherited_from \cItemBaseAbstract::CREATE_FAILURE
inherited_from \Item::CREATE_FAILURE
inherited_from \cApiAction::CREATE_FAILURE
inherited_from \cApiClickableAction::CREATE_FAILURE
 

Callbacks are executed if item could be created successfully.

CREATE_SUCCESS 
Inherited

Expected parameters for callback: ID of created item

inherited_from \cGenericDb::CREATE_SUCCESS
inherited_from \cItemBaseAbstract::CREATE_SUCCESS
inherited_from \Item::CREATE_SUCCESS
inherited_from \cApiAction::CREATE_SUCCESS
inherited_from \cApiClickableAction::CREATE_SUCCESS
 

Callbacks are executed before deleting an item.

DELETE_BEFORE 
Inherited

Expected parameters for callback: ID of them item to delete

inherited_from \cGenericDb::DELETE_BEFORE
inherited_from \cItemBaseAbstract::DELETE_BEFORE
inherited_from \Item::DELETE_BEFORE
inherited_from \cApiAction::DELETE_BEFORE
inherited_from \cApiClickableAction::DELETE_BEFORE
 

Callbacks are executed if deletion of an item fails.

DELETE_FAILURE 
Inherited

Expected parameters for callback: ID of them item to delete

inherited_from \cGenericDb::DELETE_FAILURE
inherited_from \cItemBaseAbstract::DELETE_FAILURE
inherited_from \Item::DELETE_FAILURE
inherited_from \cApiAction::DELETE_FAILURE
inherited_from \cApiClickableAction::DELETE_FAILURE
 

Callbacks are executed if item was deleted successfully.

DELETE_SUCCESS 
Inherited

Expected parameters for callback: ID of them item to delete

inherited_from \cGenericDb::DELETE_SUCCESS
inherited_from \cItemBaseAbstract::DELETE_SUCCESS
inherited_from \Item::DELETE_SUCCESS
inherited_from \cApiAction::DELETE_SUCCESS
inherited_from \cApiClickableAction::DELETE_SUCCESS
 

QUESTIONACTION_PROMPT

QUESTIONACTION_PROMPT 
Inherited
inherited_from \cApiClickableAction::QUESTIONACTION_PROMPT
 

QUESTIONACTION_YESNO

QUESTIONACTION_YESNO 
Inherited
inherited_from \cApiClickableAction::QUESTIONACTION_YESNO
 

Callbacks are executed before store process is executed.

STORE_BEFORE 
Inherited

Expected parameters for callback: Item instance

inherited_from \cGenericDb::STORE_BEFORE
inherited_from \cItemBaseAbstract::STORE_BEFORE
inherited_from \Item::STORE_BEFORE
inherited_from \cApiAction::STORE_BEFORE
inherited_from \cApiClickableAction::STORE_BEFORE
 

Callbacks are executed if store process failed.

STORE_FAILURE 
Inherited

This is also likely to happen if query would not change anything in database! Expected parameters for callback: Item instance

inherited_from \cGenericDb::STORE_FAILURE
inherited_from \cItemBaseAbstract::STORE_FAILURE
inherited_from \Item::STORE_FAILURE
inherited_from \cApiAction::STORE_FAILURE
inherited_from \cApiClickableAction::STORE_FAILURE
 

Callbacks are executed if store process saved the values in the database.

STORE_SUCCESS 
Inherited

Expected parameters for callback: Item instance

inherited_from \cGenericDb::STORE_SUCCESS
inherited_from \cItemBaseAbstract::STORE_SUCCESS
inherited_from \Item::STORE_SUCCESS
inherited_from \cApiAction::STORE_SUCCESS
inherited_from \cApiClickableAction::STORE_SUCCESS