wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
Table Class Reference
+ Inheritance diagram for Table:

Public Member Functions

 Table ($type, $oid=null)
 
 reIndex ()
 
 getNumRows ()
 
 getColumns ()
 
 getRow ($index)
 
 getColumn ($name)
 
 insertRow ($index=null, $values=array())
 
 deleteRow ($index)
 
 getValueProperties ($name, $type=null)
 
 setValueProperties ($name, $properties, $type=null)
 
- Public Member Functions inherited from PersistentObject
 PersistentObject ($type, $oid=null)
 
 getType ()
 
 setType ($type)
 
 getBaseType ()
 
 getOID ()
 
 getBaseOID ()
 
 setOID ($oid)
 
 getDBID ()
 
 setDBID ($id)
 
getMapper ()
 
getDataConverter ()
 
 save ()
 
 delete ($recursive=true)
 
 getState ()
 
 setState ($state, $recursive=true)
 
 setImmutable ()
 
 getLock ()
 
duplicate ()
 
 copyValues (&$object, $dataTypes=array(), $copyPkValues=true)
 
 copyValueIntern (&$node, $valueName, $dataType, &$targetNode, $dataTypes, $valuesToIgnore)
 
 clearValues ($dataTypes=array())
 
 clearValueIntern (&$node, $valueName, $dataType, $dataTypes)
 
 updateOID ()
 
 afterCreate ()
 
 beforeInsert ()
 
 afterInsert ()
 
 afterLoad ()
 
 beforeUpdate ()
 
 afterUpdate ()
 
 beforeDelete ()
 
 afterDelete ()
 
 hasValue ($name, $type=null)
 
 getValue ($name, $type=null)
 
 removeValue ($name, $type=null)
 
 getUnconvertedValue ($name, $type=null)
 
 getConvertedValue ($name, $type=null)
 
 getValueTypes ($name)
 
 validateValues ()
 
 validateValueIntern (&$node, $valueName, $dataType, &$errorMsg)
 
 validateValue ($name, $value, $type=null)
 
 validateValueAgainstRestrictions ($name, $value, $type=null)
 
 setValue ($name, $value, $type=null, $forceSet=false)
 
 getValueProperties ($name, $type=null)
 
 setValueProperties ($name, $properties, $type=null)
 
 getValueProperty ($name, $property, $type=null)
 
 setValueProperty ($name, $property, $value, $type=null)
 
 getValueNames ($type=null)
 
 getDataTypes ()
 
 getProperty ($name)
 
 setProperty ($name, $value)
 
 getPropertyNames ()
 
 addChangeListener (&$listener)
 
 removeChangeListener (&$listener)
 
 propagateValueChange ($name, $type, $oldValue, $newValue)
 
 propagatePropertyChange ($name, $oldValue, $newValue)
 
 propagateStateChange ($oldValue, $newValue)
 
 getObjectDisplayName ()
 
 getObjectDescription ()
 
 getDisplayValue ()
 
 getValueDisplayName ($name, $type=null)
 
 getValueDescription ($name, $type=null)
 
 toString ($verbose=false)
 
 isIndexInSearch ()
 
- Public Member Functions inherited from Storable
 getClassDefinitionFiles ()
 
 loadFromSession ()
 
 saveToSession ()
 

Public Attributes

 $_valueProperties = array()
 
- Public Attributes inherited from PersistentObject
 $_oid = null
 
 $_type = ''
 
 $_data = array()
 
 $_properties = array()
 
 $_state = STATE_CLEAN
 
 $_isImmutable = false
 
 $_changeListeners = array()
 

Detailed Description

Table is a PersistentObject that holds a table structure. The rows of the table correspond to the value names of the PersistentObject and the columns to the datatypes. So if you want to set the value of row $i and column $j to $value call $table->setValue($i, $value, $j). To retrieve the corresponding value call $value = $table->getValue($i, $j).

wCMF - wemove Content Management Framework Copyright (C) 2005-2014 wemove digital solutions GmbH

Licensed under the terms of any of the following licenses at your choice:

See the license.txt file distributed with this work for additional information.

Id:
class.Table.php 1462 2014-02-04 23:52:27Z iherwig
Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 34 of file class.Table.php.

Member Function Documentation

Table::Table (   $type,
  $oid = null 
)

Constructor.

Parameters
typeThe Tables type.
oidThe Tables oid (, optional will be calculated if not given or not valid).

Definition at line 42 of file class.Table.php.

References PersistenceFacade\composeOID(), PersistenceFacade\isValidOID(), PersistentObject\setState(), STATE_CLEAN, and STATE_NEW.

+ Here is the call graph for this function:

Table::reIndex ( )

Reset all row indizes to an ascending sequence starting by 0.

Definition at line 62 of file class.Table.php.

References getColumns().

+ Here is the call graph for this function:

Table::getNumRows ( )

Get all row names of the table.

Returns
An array of row names.

Definition at line 71 of file class.Table.php.

References getColumns(), and PersistentObject\getValueNames().

Referenced by getColumn(), and insertRow().

+ Here is the call graph for this function:

Table::getColumns ( )

Get all column names of the table.

Returns
An array of column names.

Definition at line 80 of file class.Table.php.

References PersistentObject\getDataTypes().

Referenced by deleteRow(), getNumRows(), getRow(), insertRow(), and reIndex().

+ Here is the call graph for this function:

Table::getRow (   $index)

Get all column values of a row.

Parameters
indexThe index of the row (zero based).
Returns
An array of column values.

Definition at line 89 of file class.Table.php.

References getColumns(), and PersistentObject\getValue().

+ Here is the call graph for this function:

Table::getColumn (   $name)

Get all row values of a column.

Parameters
nameThe name of the cloumn.
Returns
An array of row values.

Definition at line 102 of file class.Table.php.

References getNumRows(), and PersistentObject\getValue().

+ Here is the call graph for this function:

Table::insertRow (   $index = null,
  $values = array() 
)

Insert a new row before a given row.

Parameters
indexThe index of the row before which the new row should be inserted (zero based) [maybe null].
valuesAn assoziative array with column name keys and values to insert. If the name is empty or does not exist the row will be appended to the end of the table.
Note
this method only works for numerical names.

Definition at line 117 of file class.Table.php.

References getColumns(), getNumRows(), PersistentObject\setState(), and STATE_DIRTY.

+ Here is the call graph for this function:

Table::deleteRow (   $index)

Remove a row.

Parameters
indexThe index of the row to remove (zero based).
Note
this method only works for numerical names.

Definition at line 139 of file class.Table.php.

References getColumns(), PersistentObject\setState(), and STATE_DIRTY.

+ Here is the call graph for this function:

Table::getValueProperties (   $name,
  $type = null 
)
See Also
PersistenceObject::getValueProperties() We override this method because we only need to store the value properties once, not for every row.
Note
The type (= column name) must be given, the name (= row name) is ignored.

Definition at line 150 of file class.Table.php.

Table::setValueProperties (   $name,
  $properties,
  $type = null 
)
See Also
PersistenceObject::setValueProperties() We override this method because we only need to store the value properties once, not for every row.
Note
The type (= column name) must be given, the name (= row name) is ignored.

Definition at line 162 of file class.Table.php.

References PersistentObject\setState(), and STATE_DIRTY.

+ Here is the call graph for this function:

Member Data Documentation

Table::$_valueProperties = array()

Definition at line 36 of file class.Table.php.


The documentation for this class was generated from the following file: