Type of session statistic abstract base class

Class Methods

The following methods can be invoked on instances of this class.

optionHasMedia()

optionShouldRecordChanges()

dbQueryInsertOrReplace()

fieldsGetName()

Returns the text field which is to be converted to int

register(string strName)

Registers an entity or returns its id if it already exists

getName(int iId)

Returns the name of a browser from its id

fieldsGetPrimaryKey()

Returns the primary key

fieldsGetCreatedAt()

Returns the name of the field holding the creation date of an entity

fieldsGetModifiedAt()

Returns the name of the field holding the modification date of an entity

getOrder()

Returns the columns that this data adapter defaultly orders by when executing
the getAll() method The result is a two dimensional array consisting of column names and the direction of the order. For example, the following would sort contacts by their last name ascending and in the event of two contacts having the same last name, their first name descending array(array('contact_last_name', 'asc'), array('contact_first_name', 'desc'))

changePush(array arrChange)

Pushes a group of changes for the current component

changePop()

Pops the last group of changes

changeRecord(mixed strEntityId, mixed arrEntity, mixed strChangeType, string strReason)

Records a history entry

dbGetTableName()

Returns the name of the database table this dataadapter controls

dbGetJoins()

Returns an array of the table joins
Example syntax: // LEFT JOIN commerce_sales USING(contact_id) $arrJoins = array(array('commerce_sales', 'contact_id')) // LEFT JOIN commerce_sales ON (customers_contacts.contact_id = commerce_sales.contact_id) $arrJoins = array(array('commerce_sales', array('contact_id', 'contact_id'))) // LEFT JOIN foreign_table2 ON (foreign_table1.foreign_field1 = foreign_table2.foreign_field2) $arrJoins = array(array('foreign_table2', array('foreign_table1.foreign_field1', 'foreign_field2')))

dbGetAssociatedTables()

Returns a linear array of the tables associated to this component

dbQueryBuildSelect(mixed arrColumns)

Returns the SELECT clause from a set of columns

dbQueryBuildFrom(array arrJoins)

Returns the from clause inclusive of " FROM "
Example syntax: // LEFT JOIN commerce_sales USING(contact_id) $arrJoins = array(array('commerce_sales', 'contact_id')) // LEFT JOIN commerce_sales ON (customers_contacts.contact_id = commerce_sales.contact_id) $arrJoins = array(array('commerce_sales', array('contact_id', 'contact_id'))) // LEFT JOIN foreign_table2 ON (foreign_table1.foreign_field1 = foreign_table2.foreign_field2) $arrJoins = array(array('foreign_table2', array('foreign_table1.foreign_field1', 'foreign_field2')))

dbQueryBuildWhereHelper(array arrFilter)

Recursively converts array filters to SQL filters
$arrFilter = array( array('contact_postcode', '>', 4000), 'AND', array('contact_postcode', '<', 5000) )

dbQueryBuildWhere(array arrFilter)

Returns the WHERE clause inclusive of " WHERE "

dbQueryBuildGroupBy(mixed arrGroupBy)

dbQueryBuildOrderBy(array arrOrder, mixed bNoDefault)

Returns a complete order by clause including the "ORDER BY" statement
Note: This static function can be overridden if the user wishes to make a tricky order by clause.

dbQueryBuildLimit(mixed iStart, int iLimit)

Returns a LIMIT clause

dbQueryBuildSetStatement(mixed arrEntity, bool bIncludeKey)

Generates a SET statement for SQL

dbOptimiseTable()

Optimizes the database table

dbIsSystemTable()

dbDropTable(mixed bAllowDropSystem)

Drops a custom table

dbAlterField(array arrField, mixed strAfter)

Modifies a database field

dbDropField(string strField)

Drops a custom field

dbAddIndex(mixed strField, string strIndex, mixed strIndexName)

Adds an index on a field

dbDropIndex(mixed strIndexKey, mixed bAllowDropSystem)

Drops an index

dbGetSystemFields(mixed strTableName)

Get the system fields for the table associated to this component

dbGetSystemFieldsList()

Get a list of the system fields

dbIndexesRebuild()

dbIndexesRebuildFullText()

Recreates the fulltext index for the entire table
TODO: move this to custom fields

dbSave(mixed arrEntity)

Saves an entity

dbSaveColumn(mixed strKeyValue, mixed strColumn, mixed strValue)

fieldsGetPrefix()

Returns the field prefix used for this component

fieldsGetInvisible()

Returns the field that contains the invisibility flag

fieldsGetAllImages()

Returns an array of fields that are images

fieldsGetAllHTML()

Returns an array of fields which may contain HTML

fieldsGetAllNoHistory()

Returns an array of fields which are excluded from saving history

indexesGetAll()

Returns all the indexes in the table

fieldsGetAll(mixed bCached)

Returns all the columns this component supports

fieldsIsEditable(string strField)

Determines if a specific field was tagged as editable in the JSON shema

fieldsGetAllEditable()

Returns all the fields which were tagged as editable in the JSON schema

fieldsGetAllFlat(mixed bCached)

Returns a linear array of the columns that this dataadapter support.

fieldsGet(string strField)

Retrieves a single column

fieldsGetAllForcedAsStrings()

Returns fields that must be treated as strings when writing to the database

fieldsGetAllSearchable()

Returns fields to be used via search()

fieldsCustomGetAll()

Returns all the columns in the custom fields table

fieldsCustomGetAllExt(mixed bPublic, mixed bShowInLists, mixed bSearchable, mixed bManualSales)

Returns all the columns in the custom fields table

fieldsCustomGetIsCustom(string strField)

Check if the field is customisable or not

securityOperationsGetAll()

getSchema()

Returns the JSON schema of the component primary table

get(mixed strKey)

Returns an entity

getColumn(mixed strKey, string strColumn)

Returns a single column of an entity

getExistingEntity(mixed arrEntity, mixed bUseComponentOwnScope)

getIsNewEntity(mixed arrEntity, mixed bUseComponentLogic)

dbGet(mixed strKeyValue)

Returns an entity without a filesystem fallback

dbDeleteWithFilter(mixed arrFilter)

getWithFilter(array arrFilter)

Returns an entity without a filesystem fallback

getAll(mixed arrProperties)

getAllLocal(array arrProperties)

Returns a collection of entities

getCount(array arrFilter)

Returns a count of all rows in the data adapter

getAllIds()

Returns a linear array of all ids of enities in the data adapter

getAutoIncrementId(mixed arrEntity)

Returns the last inserted id

optionCanRollbackChanges()

Determines if changes on the component can be rollbacked

mediaUrlGet(mixed strKey, string strFileName)

Returns the URL for a specific media/entity couple

mediaFolderGet(mixed strKey)

Returns the media folder for this data adapter

mediaFolderCreate(string strKey)

Creates the media folder for an entity

nullifyIfNotSet(mixed arrEntity, string strField)

Nullifies $arrEntity[$strField] if its not set

nullifyIfEmpty(mixed arrEntity, string strField)

Nullifies $arrEntity[$strField] is an empty string

saveHandleArrayField(mixed arrEntity, string strField)

Nullifies $arrEntity[$strField] if its an empty array, or serializes it

getHandleArrayField(mixed arrEntity, mixed strField)

securityHasCustomOperations()

If this method returns true, the default security settings will not be applied to
the save and delete methods.

securityOperationsValidate(string strOperationId)

Throws ExceptionSecurity if the operation is not valid for the current user

securityOperationsIsValid(string strOperationId)

Returns whether or not a security operation is valid

securityOperationsIsSet(string strOperationId)

Returns whether or not a security operation has been set / defined

getTotalSize()

Returns the size of the table

search(string strSearch, mixed arrProperties)

Performs a search

saveColumn(mixed strKeyValue, mixed strColumn, mixed strValue, string strReason)

Changes a column of an existing entity
Supports primary keys spanning on several columns if passing $strKeyValue as an associative arry

_save(mixed arrEntity, string strReason)

Saves an entity

save(mixed arrEntity, string strReason)

Saves an entity and triggers the pre/post component events

saveWriteImages(array arrEntity)

Writes the image to the filesystem and updates $arrEntity

saveCleanHTMLFields(array arrEntity)

Cleans all html fields specified by fieldsGetAllHTML()

saveCleanHTMLField(string strHTML)

Cleans a single html field

saveCleanHTMLFieldCbFixURL(mixed strURL)

saveCleanHTMLFieldCbFixLinks(array arrMatches)

Ensures that any hyperlinks to pages have correct slashes

saveCleanHTMLFieldCbFixImages(array arrMatches)

Ensures that any images are correctly resized and that static remote images are
downloaded to the local media folder

saveMultiple(array arrEntities)

Saves multiple entities

baseMove(mixed strKeyValue, string strKeyValueNew)

Moves / renames the resources associated to an entity
Expensive! Use only for textual ids such as page ids

baseSaveRequirePrimaryKey(mixed arrEntity)

baseSave(mixed arrEntity, string strReason)

Saves an entity

baseDelete(mixed strKeyValue, bool bDeleteMedia)

Deletes the resources associated to an entity

_delete(mixed strKeyValue, bool bDeleteMedia, mixed strReason)

Deletes an entity from the database

delete(mixed strKeyValue, bool bDeleteMedia, mixed strReason)

Deletes an entity and triggers the pre/post component events

deleteWithFilter(array arrFilter)

Deletes entities using a filter

_move(mixed strKeyValue, string strKeyValueNew)

Moves / renames an entity

move(mixed strKeyValue, string strKeyValueNew)

Moves / renames an entity and triggers the pre/post component events

_cloneEntity(mixed strOldKey, mixed strNewKey, bool bCloneMedia)

Clones an entity, resaving it with a new key value

cloneEntity(mixed strOldKey, mixed strNewKey, bool bCloneMedia)

Clones an entity and triggers the pre/post component events

alterEntity(array arrEntity)

Called whenever retrieving an entity

analyticsGetDateField()

Returns the name of the date field which analytics are based off

analyticsGetDateFilter(mixed strDateStart, string strDateEnd)

Returns a data filter for a date range

analyticsGetAll(mixed strDateStart, mixed strDateEnd, mixed arrProperties)

analyticsGetCount(mixed strDateStart, mixed strDateEnd, array arrProperties)

Returns the total number of records for a period

analyticsGetCounts(mixed strDateStart, mixed strDateEnd, array arrProperties)

Returns the number of records over a period

analyticsGetMetric(mixed strMetricName, mixed strDateStart, mixed strDateEnd, array arrProperties)

Retrieves a metric defined for the current component

analyticsGetSum(mixed strColumn, mixed strDateStart, mixed strDateEnd, array arrProperties)

Returns the sum of a column for a period

analyticsGetSums(mixed strColumn, mixed strDateStart, mixed strDateEnd, array arrProperties)

Returns the sums of a column over a period

analyticsGetTypes(mixed strTypeColumn, mixed strDateStart, mixed strDateEnd, mixed arrProperties)

cacheIsSet(mixed mixedKey)

cacheGet(mixed mixedKey)

cacheKeyFromKey(mixed mixedKey)

Returns a key for the query cache array from the value of a primary key

cacheKeyFromEntity(array arrEntity)

Returns a key for the query cache array for a particular entity

cacheSavePartial(array arrEntity)

Updates the cache with an entity to be saved

cacheSaveFull(mixed mixedKeyValue, array arrEntity)

Updates the cache with a full entity fetched from the db

cacheSaveColumn(mixed mixedKeyValue, mixed strColumn, string strValue)

Updates the cache with a column value to be saved

cacheDelete(string mixedKeyValue)

Deletes an item, setting its cache to null

cacheFlush()

Flushes / clears the cache

cacheFlushAll()

Flushes / clears the cache for all components

install()

uninstall()

classGetFolderSystemFields()

Returns the folder where the class's fields exist

componentIsInstalled()

Determines if a specific component is installed

componentGetEntityType(mixed arrEntity)

Returns the type of entity handled by the component

componentGetEntityIcon()

Retrieves the default icon path for the component entities

componentGetFeature()

Returns the feature the current component belongs to

eventGetHandlers()

Returns a set of event handlers for this component

eventTrigger(mixed strEvent, array arrEventParams)

Triggers a component event

configGetAll(array arrProperties)

Retrieves all config items for the component

configGetAllValues(array arrProperties)

Retrieves all config items for the component in a item_id => item_value fashion

configGetValue(string strConfigId)

Retrieves the value of a config item for the current component

configSaveValue(mixed strConfigId, mixed strValue, string strReason)

Saves the value of a config item for the current component

uiGetActions(mixed bInList, bool bInEdit)

Returns an array of user interface actions for the component

__call(mixed strName, array arrArguments)

Magic function to trap calls to undefined functions and throw an exception rather than
a fatal error.

__callStatic(mixed strName, array arrArguments)

Magic function to trap static calls to undefined functions and throw an exception rather
than a fatal error.

classGetFolder()

Returns the folder where the class exists

__set_state(mixed arrValues)

classGetFolderResources()

Returns the folder where the class's resources exist

classGetSrcFile()

Returns the folder where the class exists

classGetSrcHash()

Returns the folder where the class exists

classGetReflection()

Returns the reflection data for the current class

classGetReflectionAnnotation(string strField)

Returns a specific class annotation for the current class