Module access class

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

 Methods

Constructor Function

Item(string $table, string $primaryKey, $lifetime) 
Inherited
inherited_from \Item::Item()

Parameters

$table

string

The table to use as information source

$primaryKey

string

The primary key to use

$lifetime

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

_inFilter(mixed $data) : mixed
Inherited
see \setFilters
access private
inherited_from \Item::_inFilter()

Parameters

$data

mixed

Data to filter

Returns

mixedFiltered data

_makeFileDirectoryStructure()

_makeFileDirectoryStructure() 

_onLoad ()

_onLoad() : \none
Inherited

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

inherited_from \Item::_onLoad()

Returns

\none

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

_outFilter(mixed $data) : mixed
Inherited
see \setFilters
access private
inherited_from \Item::_outFilter()

Parameters

$data

mixed

Data to filter

Returns

mixedFiltered data

_parseImportFile Parse import xml file, stores data in global variable (-> event handler functions)

_parseImportFile(string $sFile, $sType, $sEncoding) 

@access private

Parameters

$sFile

string

Filename including path of import xml file @param string $sType Import type, "module" or "package" @return bool Returns true, if file has been parsed

$sType

$sEncoding

_setMetaObject()

_setMetaObject($objectname) 
Inherited
inherited_from \Item::_setMetaObject()

Parameters

$objectname

_shouldLoadFromFiles()

_shouldLoadFromFiles() 

_shouldStoreToFile()

_shouldStoreToFile() 

Constructor Function

cApiModule($loaditem) 

Parameters

$loaditem

Item to load

deleteProperty ($type, $name) Deletes a custom property

deleteProperty(string $type, string $name) 
Inherited
inherited_from \Item::deleteProperty()

Parameters

$type

string

Specifies the type

$name

string

Specifies the name

export Exports the specified module strings to a file

export($filename, $return) 

Parameters

$filename

string Filename to return

$return

boolean if false, the result is immediately sent to the browser

exportPackage Exports the specified module and attached files to a file

exportPackage(string $sPackageFileName, bool $bReturn) 

Parameters

$sPackageFileName

string

Filename to return

$bReturn

bool

if false, the result is immediately sent to the browser

get($field) Wrapper for getField (less to type)

get(string $field) : mixed
Inherited
inherited_from \Item::get()

Parameters

$field

string

Specifies the field to retrieve

Returns

mixedValue of the field

getField($field) Gets the value of a specific field

getField(string $field) : mixed

Parameters

$field

string

Specifies the field to retrieve

Returns

mixedValue of the field

getMetaObject()

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

getPackageOverview()

getPackageOverview($sFile) 

Parameters

$sFile

getProperty ($type, $name) Sets a custom property

getProperty(string $type, string $name) : boolean
Inherited
inherited_from \Item::getProperty()

Parameters

$type

string

Specifies the type

$name

string

Specifies the name

Returns

booleanValue of the given property

getTranslatedName Returns the translated name of the module if a translation exists.

getTranslatedName() : string

Returns

stringTranslated module name or original

Get the informations of used templates

getUsedTemplates() : array

Returns

arraytemplate data

import Imports the a module from a XML file Uses xmlparser and callbacks

import($sFile) 

Parameters

$sFile

importPackage Imports a module package from a XML file Uses xmlparser and callbacks

importPackage(string $sFile, array $aOptions) : bool

Parameters

$sFile

string

Filename of data file (including path)

$aOptions

array

Optional. An array of arrays specifying, how the items of the xml file will be imported. If specified, has to contain an array of this structure: $aOptions["items"][][] = "skip", "append" or "overwrite"; $aOptions["translations"][] = ; If a file is not mentioned in the $aOptions["items"][] array, it is new and will be imported. If a is not found in $aOptions["translations"], then the translations for this language will be ignored

Returns

boolReturns true, if import has been successfully finished

isOldModule() Checks if the module is a pre-4.3 module

isOldModule() : boolean

Returns

booleantrue if this module is an old one

loadBy ($field, $value) Loads an item by colum/field from the database

loadBy(string $field, string $value, bool $bSafe) : bool
Inherited
inherited_from \Item::loadBy()

Parameters

$field

string

Specifies the field

$value

string

Specifies the value

$bSafe

bool

use inFilter or not

Returns

boolTrue if the load was successful

loadByPrimaryKey ($value) Loads an item by ID from the database

loadByPrimaryKey($id) : bool

Parameters

$id

Returns

boolTrue if the load was successful

moduleInUse() Checks if the module is in use

moduleInUse($module, $bSetData) : bool

Parameters

$module

$bSetData

Returns

boolSpecifies if the module is in use

parseModuleForStrings Parses the module for mi18n strings and returns them in an array

parseModuleForStrings() : array

Returns

arrayFound strings for this module

set($field, $value) Shortcut to setField

set(string $field, string $value, $safe) 
Inherited
inherited_from \Item::set()

Parameters

$field

string

Specifies the field to set

$value

string

Specifies the value to set

$safe

setField($field, $value) Sets the value of a specific field

setField(string $field, string $value, boolean $safe) 
Inherited
inherited_from \Item::setField()

Parameters

$field

string

Specifies the field to set

$value

string

Specifies the value to set

$safe

boolean

Speficies if we should translate characters

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

setFilters(array $arrInFilters, array $arrOutFilters) : void
Inherited

Examples:

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

inherited_from \Item::setFilters()

Parameters

$arrInFilters

array

inFilters array with function names

$arrOutFilters

array

outFilters array with function names

setProperty ($type, $name, $value) Sets a custom property

setProperty(string $type, string $name, string $value) 
Inherited
inherited_from \Item::setProperty()

Parameters

$type

string

Specifies the type

$name

string

Specifies the name

$value

string

Specifies the value

setTranslatedName Sets the translated name of the module

setTranslatedName($name) : \none

Parameters

$name

string Translated name of the module

Returns

\none

store() Stores the modified user object to the database

store($bJustStore) 

Parameters

$bJustStore

 Properties

 

$_arrInFilters : array
Inherited
access private
inherited_from \Item::$$_arrInFilters
 

$_arrOutFilters : array
Inherited
access private
inherited_from \Item::$$_arrOutFilters
 

$_error 
 

$_metaObject 
Inherited
inherited_from \Item::$$_metaObject
 

$_packageStructure 
 

$cache : array
Inherited
access private
inherited_from \Item::$$cache
 

$db : object
Inherited
access private
inherited_from \Item::$$db
 

$lasterror : string
Inherited
access private
inherited_from \Item::$$lasterror
 

Lifetime in seconds

$lifetime : int
Inherited
access private
inherited_from \Item::$$lifetime
 

$modifiedValues : array
Inherited
access private
inherited_from \Item::$$modifiedValues
 

$oldPrimaryKey : string
Inherited
access private
inherited_from \Item::$$oldPrimaryKey
 

$primaryKey : object
Inherited
access private
inherited_from \Item::$$primaryKey
 

PropertyCollection object

$properties : object
Inherited
access private
inherited_from \Item::$$properties
 

$table : string
Inherited
access private
inherited_from \Item::$$table
 

$values : array
Inherited
access private
inherited_from \Item::$$values
 

$virgin : boolean
Inherited

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

access private
inherited_from \Item::$$virgin
 

$aUsedTemplates : array