Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentRssCreator
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • 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
  • Smarty
    • Cacher
    • Compiler
    • Config
    • Debug
    • PluginsBlock
    • PluginsFilter
    • PluginsFunction
    • PluginsInternal
    • PluginsModifier
    • PluginsModifierCompiler
    • PluginsShared
    • Security
    • Template
    • TemplateResources
  • Swift
    • ByteStream
    • CharacterStream
    • Encoder
    • Events
    • KeyCache
    • Mailer
    • Mime
    • Plugins
    • Transport

Classes

  • ArticleForum
  • cGenericDb
  • cGenericDbDriver
  • cGenericDbDriverMysql
  • cItemBaseAbstract
  • cItemCache
  • Item
  • ItemCollection
  • Overview
  • Package
  • Class
  • Todo
  • Download

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, cApiSearchTracking, cApiShortUrl, cApiStat, cApiSystemProperty, cApiArticle, cApiTemplate, cApiTemplateConfiguration, cApiType, cApiUpload, cApiUploadMeta, cApiUser, cApiUserPasswordRequest, cApiUserProperty, Newsletter, NewsletterJob, cApiArticleLanguage, NewsletterLog, NewsletterRecipient, NewsletterRecipientGroup, NewsletterRecipientGroupMember, PifaField, PifaForm, PimPlugin, PimPluginRelations, Workflow, WorkflowAction, cApiArticleSpecification, WorkflowAllocation, WorkflowArtAllocation, WorkflowItem, WorkflowTask, WorkflowUserSequence, cApiCategory, cApiCategoryArticle

Indirect known subclasses

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, integer $iLifetime,… )

Constructor function

Constructor function

Parameters

$sTable
The table to use as information source
$sPrimaryKey
The primary key to use
$iLifetime,…

Throws

cInvalidArgumentException
If table name or primary key is not set

Overrides

cItemBaseAbstract::__construct()
protected
# _resetItem( )

Resets class variables back to default This is handy in case a new item is tried to be loaded into this class instance.

Resets class variables back to default This is handy in case a new item is tried to be loaded into this class instance.

Overrides

cItemBaseAbstract::_resetItem()
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
Specifies the field
$mValue
Specifies the value
$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
associative array with field / value pairs
$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
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
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
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, boolean $bSafe = true )

Gets the value of a specific field.

Gets the value of a specific field.

Parameters

$sField
Specifies the field to retrieve
$bSafe
Flag to run defined outFilter on passed value

Returns

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

Wrapper for getField (less to type).

Wrapper for getField (less to type).

Parameters

$sField
Specifies the field to retrieve
$bSafe
Flag to run defined outFilter on passed value

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
Field name
$mValue
Value to set
$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
Field name
$mValue
Value to set
$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
Specifies the type
$sName
Specifies the name
$mValue
Specifies the value
$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
Specifies the type
$sName
Specifies the name
$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
Specifies the type
$sName
Specifies the name
$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
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 with function names
$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
Data to filter

Returns

mixed
Filtered data

See

Item::setFilters()

Todo

This method is used from public scope, but it should be protected
public 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
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
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

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.

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

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

# array( 'stripslashes', 'htmldecode' )
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.7 API documentation generated by ApiGen