Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • ArticleForum
  • cApiShortUrl
  • cGenericDb
  • cGenericDbDriver
  • cGenericDbDriverMysql
  • cItemBaseAbstract
  • cItemCache
  • Item
  • ItemCollection
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo

Class Item

Class Item Abstract class for database based items.

cGenericDb
Extended by cItemBaseAbstract
Extended by Item

Direct known subclasses

ArticleForum, ArticleForumItem, cApiCategoryLanguage, cApiCategoryTree, cApiClient, cApiClientLanguage, cApiCommunication, cApiContainer, cApiContainerConfiguration, cApiContent, cApiDbfs, cApiFile, cApiAction, cApiFileInformation, cApiFrameFile, cApiFrontendGroup, cApiFrontendGroupMember, cApiFrontendPermission, cApiFrontendUser, cApiGroup, cApiGroupMember, cApiGroupProperty, cApiInUse, cApiActionlog, cApiIso3166, cApiIso6392, cApiKeyword, cApiLanguage, cApiLayout, cApiMailLog, cApiMailLogSuccess, cApiMetaTag, cApiMetaType, cApiModule, cApiArea, cApiNavMain, cApiNavSub, cApiOnlineUser, cApiPathresolveCache, cApiProperty, cApiRight, cApiShortUrl, cApiStat, cApiSystemProperty, cApiTemplate, cApiArticle, cApiTemplateConfiguration, cApiType, cApiUpload, cApiUploadMeta, cApiUser, cApiUserProperty, Newsletter, NewsletterJob, NewsletterLog, NewsletterRecipient, cApiArticleLanguage, NewsletterRecipientGroup, NewsletterRecipientGroupMember, PifaField, PifaForm, PimPlugin, PimPluginRelations, Workflow, WorkflowAction, WorkflowAllocation, WorkflowArtAllocation, cApiArticleSpecification, WorkflowItem, WorkflowTask, WorkflowUserSequence, cApiCategory, cApiCategoryArticle

Indirect known subclasses

cApiClickableAction, cApiClickableQuestionAction, NoteItem, TODOItem
Abstract
Package: Core\GenericDB
Copyright: four for business AG <www.4fb.de>
License: http://www.contenido.org/license/LIZENZ.txt
Author: Timo Hummel
Author: Murat Purc <murat@purc.de>
Located at classes/genericdb/class.item.php
Methods summary
public
# __construct( string $sTable, string $sPrimaryKey )

Constructor function

Constructor function

Parameters

$sTable
string
$sTable The table to use as information source
$sPrimaryKey
string
$sPrimaryKey The primary key to use

Throws

cInvalidArgumentException
If table name or primary key is not set

Overrides

cItemBaseAbstract::__construct()
public boolean
# loadBy( string $sField, mixed $mValue, boolean $bSafe = true )

Loads an item by colum/field from the database.

Loads an item by colum/field from the database.

Parameters

$sField
string
$sField Specifies the field
$mValue
mixed
$mValue Specifies the value
$bSafe
boolean
$bSafe Use inFilter or not

Returns

boolean
True if the load was successful

Throws

cException
if more than one item has been found matching the given arguments
public boolean
# loadByMany( array $aAttributes, boolean $bSafe = true )

Loads an item by colums/fields from the database.

Loads an item by colums/fields from the database.

Parameters

$aAttributes
array
$aAttributes associative array with field / value pairs
$bSafe
boolean
$bSafe Use inFilter or not

Returns

boolean
True if the load was successful

Throws

cException
if more than one item could be found matching the given arguments
protected boolean
# _loadByWhereClause( string $sWhere )

Loads an item by passed where clause from the database. 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.

Loads an item by passed where clause from the database. 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.

Parameters

$sWhere
string
$sWhere The where clause like 'idart = 123 AND idlang = 1'

Returns

boolean
True if the load was successful

Throws

cException
if more than one item could be found matching the given where clause
public boolean
# loadByPrimaryKey( string $mValue )

Loads an item by ID from the database.

Loads an item by ID from the database.

Parameters

$mValue
string
$mValue Specifies the primary key value

Returns

boolean
True if the load was successful
public
# loadByRecordSet( array $aRecordSet )

Loads an item by it's recordset.

Loads an item by it's recordset.

Parameters

$aRecordSet
array
$aRecordSet The recordset of the item
public boolean
# isLoaded( )

Checks if a the item is already loaded.

Checks if a the item is already loaded.

Returns

boolean
protected
# _onLoad( )

Function which is called whenever an item is loaded. Inherited classes should override this function if desired.

Function which is called whenever an item is loaded. Inherited classes should override this function if desired.

public mixed
# getField( string $sField )

Gets the value of a specific field.

Gets the value of a specific field.

Parameters

$sField
string
$sField Specifies the field to retrieve

Returns

mixed
Value of the field
public mixed
# get( string $sField )

Wrapper for getField (less to type).

Wrapper for getField (less to type).

Parameters

$sField
string
$sField Specifies the field to retrieve

Returns

mixed
Value of the field
public boolean
# setField( string $sField, string $mValue, boolean $bSafe = true )

Sets the value of a specific field.

Sets the value of a specific field.

Parameters

$sField
string
$sField Field name
$mValue
string
$mValue Value to set
$bSafe
boolean
$bSafe Flag to run defined inFilter on passed value

Returns

boolean
public
# set( string $sField, string $mValue, boolean $bSafe = true )

Shortcut to setField.

Shortcut to setField.

Parameters

$sField
string
$sField Field name
$mValue
string
$mValue Value to set
$bSafe
boolean
$bSafe Flag to run defined inFilter on passed value
public boolean
# store( )

Stores the loaded and modified item to the database.

Stores the loaded and modified item to the database.

Returns

boolean
public array
# toArray( )

Returns current item data as an assoziative array.

Returns current item data as an assoziative array.

Returns

array
false
public stdClass
# toObject( )

Returns current item data as an object.

Returns current item data as an object.

Returns

stdClass
false
public boolean
# setProperty( string $sType, string $sName, mixed $mValue, integer $iClient = 0 )

Sets a custom property.

Sets a custom property.

Parameters

$sType
string
$sType Specifies the type
$sName
string
$sName Specifies the name
$mValue
mixed
$mValue Specifies the value
$iClient
integer
$iClient Id of client to set property for

Returns

boolean
public mixed
# getProperty( string $sType, string $sName, integer $iClient = 0 )

Returns a custom property.

Returns a custom property.

Parameters

$sType
string
$sType Specifies the type
$sName
string
$sName Specifies the name
$iClient
integer
$iClient Id of client to set property for

Returns

mixed
Value of the given property or false
public boolean
# deleteProperty( string $sType, string $sName, integer $iClient = 0 )

Deletes a custom property.

Deletes a custom property.

Parameters

$sType
string
$sType Specifies the type
$sName
string
$sName Specifies the name
$iClient
integer
$iClient Id of client to delete properties

Returns

boolean
public boolean
# deletePropertyById( integer $idprop )

Deletes a custom property by its id.

Deletes a custom property by its id.

Parameters

$idprop
integer
$idprop Id of property

Returns

boolean
public
# setFilters( array $aInFilters = array(), array $aOutFilters = array() )

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

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

Examples:

$obj->setFilters(array('addslashes'), array('stripslashes'));
$obj->setFilters(array('htmlencode', 'addslashes'), array('stripslashes',
'htmlencode'));

Parameters

$aInFilters
array
$aInFilters Array with function names
$aOutFilters
array
$aOutFilters Array with function names
public mixed
# _inFilter( mixed $mData )

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

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

Parameters

$mData
mixed
$mData Data to filter

Returns

mixed
Filtered data

See

Item::setFilters()

Todo

This method is used from public scope, but it should be protected
protected mixed
# _outFilter( mixed $mData )

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

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

Parameters

$mData
mixed
$mData Data to filter

Returns

mixed
Filtered data

See

Item::setFilters()
protected
# _setMetaObject( string $metaObject )

Set meta object class name.

Set meta object class name.

Parameters

$metaObject
string
$metaObject
public object
# getMetaObject( )

Return meta object instance. This object might be retrieved from a global cache ($_metaObjectCache).

Return meta object instance. This object might be retrieved from a global cache ($_metaObjectCache).

Returns

object
Methods inherited from cItemBaseAbstract
_getPropertiesCollectionInstance(), _getSecondDBInstance(), escape()
Methods inherited from cGenericDb
_executeCallbacks(), register(), unregister()
Constants inherited from cGenericDb
CREATE_BEFORE, CREATE_FAILURE, CREATE_SUCCESS, DELETE_BEFORE, DELETE_FAILURE, DELETE_SUCCESS, STORE_BEFORE, STORE_FAILURE, STORE_SUCCESS
Properties summary
public array $values
#

Storage of the source table to use for the user informations

Storage of the source table to use for the user informations

protected array $modifiedValues
#

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

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

protected string $oldPrimaryKey
#

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

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

protected array $_arrInFilters array( 'htmlspecialchars', 'addslashes' )
#

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

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

protected array $_arrOutFilters array( 'stripslashes', 'htmldecode' )
#

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

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

protected string $_metaObject
#

Class name of meta object

Class name of meta object

protected string $_lastSQL
#

Last executed SQL statement

Last executed SQL statement

Properties inherited from cItemBaseAbstract
$_className, $_oCache, $_settings, $db, $lasterror, $primaryKey, $properties, $secondDb, $table, $virgin
CMS CONTENIDO 4.9.1 API documentation generated by ApiGen 2.8.0