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.

Base class with common features for database based items and item collections.

author Timo A. Hummel <Timo.Hummel@4fb.de>
author Murat Purc
version 0.3
copyright four for business 2003

 Methods

Constructor Function

__construct() 

Exceptions

\Contenido_ItemException 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 \Contenido_ItemBaseAbstract::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

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

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

wantParameter()

wantParameter($parameter) 
Inherited

inherited_from \cApiClickableAction::wantParameter()

Parameters

$parameter

Returns properties instance, instantiates it if not done before.

_getPropertiesCollectionInstance() : \PropertyCollection
Inherited

inherited_from \Contenido_ItemBaseAbstract::_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() : \DB_Contenido
Inherited

inherited_from \Contenido_ItemBaseAbstract::_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'

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

 

Storage of the primary key

$primaryKey : string
Inherited

inherited_from \Contenido_ItemBaseAbstract::$$primaryKey
inherited_from \Item::$$primaryKey
inherited_from \cApiAction::$$primaryKey
inherited_from \cApiClickableAction::$$primaryKey
 

Storage of the source table to use for the user informations

$values : array
Inherited

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

Checks for the virginity of created objects. If true, the object is virgin and no operations on it except load-Functions are allowed.

$virgin : bool
Inherited

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

List of funcion names of the filters used when data is stored to the db.

$_arrInFilters : array
Inherited

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

List of funcion names of the filtersused when data is retrieved from the db

$_arrOutFilters : array
Inherited

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

Classname of current instance

$_className : string
Inherited

inherited_from \Contenido_ItemBaseAbstract::$$_className
inherited_from \Item::$$_className
inherited_from \cApiAction::$$_className
inherited_from \cApiClickableAction::$$_className
 

Class name of meta object

$_metaObject : string
Inherited

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

Item cache instance

$_oCache : \Contenido_ItemCache
Inherited

inherited_from \Contenido_ItemBaseAbstract::$$_oCache
inherited_from \Item::$$_oCache
inherited_from \cApiAction::$$_oCache
inherited_from \cApiClickableAction::$$_oCache
 

$_objectInvalid

$_objectInvalid 
Inherited

inherited_from \cApiAction::$$_objectInvalid
inherited_from \cApiClickableAction::$$_objectInvalid
 

GenericDB settings, see $cfg['sql']

$_settings : array
Inherited

inherited_from \Contenido_ItemBaseAbstract::$$_settings
inherited_from \Item::$$_settings
inherited_from \cApiAction::$$_settings
inherited_from \cApiClickableAction::$$_settings
 

Cache the result items FIXME seems to not used, remove it!

$cache : array
Inherited

inherited_from \Contenido_ItemBaseAbstract::$$cache
inherited_from \Item::$$cache
inherited_from \cApiAction::$$cache
inherited_from \cApiClickableAction::$$cache
 

Database instance, contains the database object

$db : \DB_Contenido
Inherited

inherited_from \Contenido_ItemBaseAbstract::$$db
inherited_from \Item::$$db
inherited_from \cApiAction::$$db
inherited_from \cApiClickableAction::$$db
 

Storage of the last occured error

$lasterror : string
Inherited

inherited_from \Contenido_ItemBaseAbstract::$$lasterror
inherited_from \Item::$$lasterror
inherited_from \cApiAction::$$lasterror
inherited_from \cApiClickableAction::$$lasterror
 

Lifetime of results/created objects? FIXME Not used at the moment!

$lifetime : int
Inherited

inherited_from \Contenido_ItemBaseAbstract::$$lifetime
inherited_from \Item::$$lifetime
inherited_from \cApiAction::$$lifetime
inherited_from \cApiClickableAction::$$lifetime
 

Storage of the fields which were modified, where the keys are the fieldnames and the values just simple booleans.

$modifiedValues : array
Inherited

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

Stores the old primary key, just in case somebody wants to change it

$oldPrimaryKey : string
Inherited

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

Property collection instance

$properties : \PropertyCollection
Inherited

inherited_from \Contenido_ItemBaseAbstract::$$properties
inherited_from \Item::$$properties
inherited_from \cApiAction::$$properties
inherited_from \cApiClickableAction::$$properties
 

Second DB instance, is required for some additional queries without losing an current existing query result.

$secondDb : \DB_Contenido
Inherited

inherited_from \Contenido_ItemBaseAbstract::$$secondDb
inherited_from \Item::$$secondDb
inherited_from \cApiAction::$$secondDb
inherited_from \cApiClickableAction::$$secondDb
 

Storage of the source table to use for the information

$table : string
Inherited

inherited_from \Contenido_ItemBaseAbstract::$$table
inherited_from \Item::$$table
inherited_from \cApiAction::$$table
inherited_from \cApiClickableAction::$$table
 

Help text

$_helpText 
Inherited

access private
inherited_from \cApiClickableAction::$$_helpText
 

cHTMLImage for rendering the icon

$_img 
Inherited

access private
inherited_from \cApiClickableAction::$$_img