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

Public Member Functions

 NodeToSingleTableMapper ($params)
 
load ($oid, $buildDepth, $buildType=BUILDTYPE_COMPLETE, $depth=0)
 
create ($type, $buildDepth, $buildType=BUILDTYPE_COMPLETE, $depth=0)
 
 save (&$node)
 
 delete ($oid, $recursive=true)
 
getConnection ()
 
 isGroupChild ($childElementId, $parentElementId, $rootElementId)
 
 getOIDs ($type, $criteria=null)
 
 getPropertyMap ($type, $property, $attribute=null, $oid=null)
 
 getParentOID ($oid, $type=null, $buildDepth=BUILDDEPTH_SINGLE)
 
- Public Member Functions inherited from PersistenceMapper
 getType ()
 
 getPkNames ()
 
 setDataConverter ($dataConverter)
 
 getDataConverter ()
 
 enableLogging ($logStrategy)
 
 disableLogging ()
 
 isLogging ()
 
 logAction (&$obj)
 
load ($oid, $buildDepth, $buildAttribs=null, $buildTypes=null)
 
create ($type, $buildDepth, $buildAttribs=null)
 
 save (&$object)
 
 delete ($oid, $recursive=true)
 
 checkAuthorization ($oid, $action)
 
 authorizationFailedError ($oid, $action)
 
 initialize (&$object)
 
 isValidOID ($oid)
 
loadImpl ($oid, $buildDepth, $buildAttribs=null, $buildTypes=null)
 
createImpl ($type, $buildDepth, $buildAttribs=null)
 
 saveImpl (&$object)
 
 deleteImpl ($oid, $recursive=true)
 
 getOIDs ($type, $criteria=null, $orderby=null, &$pagingInfo)
 
 loadObjects ($type, $buildDepth, $criteria=null, $orderby=null, &$pagingInfo, $buildAttribs=null, $buildTypes=null)
 
 getOrderBy ()
 
 startTransaction ()
 
 commitTransaction ()
 
 rollbackTransaction ()
 

Public Attributes

 $_conn = null
 
 $_rootElementId = 0
 
 $_rootId = 0
 
 $_groupMap = array()
 
 $_type = '*'
 
 $_dbPrefix = ''
 
- Public Attributes inherited from PersistenceMapper
 $_dataConverter = null
 
 $_type = ''
 
 $_logging = false
 
 $_logStrategy = null
 

Detailed Description

NodeToSingleTableMapper maps nodes of different types to the database. It uses a relational database scheme that simulates a xml tree. That means all nodes share one table.

Deprecated:
Use NodeRDBMapper or NodeUnifiedRDBMapper instead
Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 54 of file class.NodeToSingleTableMapper.php.

Member Function Documentation

NodeToSingleTableMapper::NodeToSingleTableMapper (   $params)

Constructor.

Parameters
paramsInitialization data given in an assoziative array with the following keys: dbType, dbHostName, dbUserName, dbPassword, dbName OR dbConnection if dbPrefix is given it will be appended to every table string, which is usefull if different cms operate on the same database

Definition at line 70 of file class.NodeToSingleTableMapper.php.

References InifileParser\getInstance(), and WCMFException\throwEx().

+ Here is the call graph for this function:

& NodeToSingleTableMapper::load (   $oid,
  $buildDepth,
  $buildType = BUILDTYPE_COMPLETE,
  $depth = 0 
)

Construct a Node from the database.

Parameters
oidThe object id of the Node to load
buildDepthOne of the BUILDDEPTH constants or a number describing the number of generations to build (except BUILDDEPTH_REQUIRED)
buildTypeOne of the BUILDTYPE constants describing the size to build
depthInternal use
Returns
A reference to the Node, null if oid does not exist.

Definition at line 112 of file class.NodeToSingleTableMapper.php.

References BUILDDEPTH_GROUPED, BUILDDEPTH_INFINITE, BUILDDEPTH_SINGLE, BUILDTYPE_NOPROPS, DATATYPE_ATTRIBUTE, DATATYPE_ELEMENT, DATATYPE_IGNORE, PersistenceFacade\getInstance(), isGroupChild(), STATE_CLEAN, and WCMFException\throwEx().

+ Here is the call graph for this function:

& NodeToSingleTableMapper::create (   $type,
  $buildDepth,
  $buildType = BUILDTYPE_COMPLETE,
  $depth = 0 
)

Construct the template of a Node of a given type (defined by element name).

Parameters
typeThe type of the Node to construct (maybe '' for an unspecified Node)
buildDepthOne of the BUILDDEPTH constants or a number describing the number of generations to build
buildTypeOne of the BUILDTYPE constants describing the size to build
depthInternal use
Returns
A reference to the Node.

Definition at line 264 of file class.NodeToSingleTableMapper.php.

References BUILDDEPTH_GROUPED, BUILDDEPTH_INFINITE, BUILDDEPTH_REQUIRED, BUILDDEPTH_SINGLE, BUILDTYPE_NOPROPS, DATATYPE_ATTRIBUTE, DATATYPE_ELEMENT, DATATYPE_IGNORE, PersistenceFacade\getInstance(), isGroupChild(), and WCMFException\throwEx().

+ Here is the call graph for this function:

NodeToSingleTableMapper::save ( $node)

Save a Node to the database (inserted if it is new).

Parameters
nodeA reference to the Node to save
Returns
True/False depending on success of operation

Definition at line 420 of file class.NodeToSingleTableMapper.php.

References DATATYPE_ATTRIBUTE, DATATYPE_ELEMENT, DATATYPE_IGNORE, PersistenceFacade\getInstance(), PersistenceMapper\logAction(), STATE_CLEAN, STATE_DIRTY, STATE_NEW, and WCMFException\throwEx().

+ Here is the call graph for this function:

NodeToSingleTableMapper::delete (   $oid,
  $recursive = true 
)

Delete a Node from the database (together with all of its children).

Parameters
oidThe object id of the Node to delete
recursiveTrue/False whether to physically delete it's children too [default: true]
Returns
True/False depending on success of operation

Definition at line 572 of file class.NodeToSingleTableMapper.php.

References BUILDDEPTH_SINGLE, PersistenceFacade\getInstance(), PersistenceMapper\isLogging(), PersistenceMapper\logAction(), and WCMFException\throwEx().

+ Here is the call graph for this function:

& NodeToSingleTableMapper::getConnection ( )

Get the database connection.

Returns
A reference to the ADONewConnection object

Definition at line 611 of file class.NodeToSingleTableMapper.php.

References $_conn.

NodeToSingleTableMapper::isGroupChild (   $childElementId,
  $parentElementId,
  $rootElementId 
)

See if a child Node is grouped with a root Node.

Parameters
childElementIdThe element id of the child Node
parentElementIdThe element id of the parent Node (necessary to identify relation)
rootElementIdThe element id of the root Node
Returns
true/false

Definition at line 622 of file class.NodeToSingleTableMapper.php.

Referenced by create(), and load().

NodeToSingleTableMapper::getOIDs (   $type,
  $criteria = null 
)

Get the object ids of nodes matching a given criteria.

Parameters
typeThe type of the object
criteriaAn assoziative array holding name value pairs of attributes (maybe null). Values maybe substrings of values to search for. [default: null]
Returns
An array containing the node oids

Definition at line 645 of file class.NodeToSingleTableMapper.php.

References PersistenceFacade\getInstance(), and WCMFException\throwEx().

+ Here is the call graph for this function:

NodeToSingleTableMapper::getPropertyMap (   $type,
  $property,
  $attribute = null,
  $oid = null 
)

Get a property (element of the node or element of a child node) of all nodes of a given type (e.g. shortnames of all contractors). If attribute is given only properties with the given value of this attribute are returned (e.g. shortnames which language attribute is 'en').

Note
The properties database type MUST be 'data_txt'.
Parameters
typeThe type of the node (e.g. 'contractor')
propertyThe type of the child node (e.g. 'shortname'). If property is null the element of the type itself will be taken
attributeAn assoziative array holding name value pairs of attributes (maybe null). Values maybe substrings of values to search for. [default: null]
oidIf oid is given the property map will only be build for this single node [default: null]
Returns
An assoziative array containing the ids of the type nodes as keys and the element values of the property nodes as values

Definition at line 687 of file class.NodeToSingleTableMapper.php.

References PersistenceFacade\getInstance(), and WCMFException\throwEx().

+ Here is the call graph for this function:

NodeToSingleTableMapper::getParentOID (   $oid,
  $type = null,
  $buildDepth = BUILDDEPTH_SINGLE 
)

Get the object id of the (next) parent (of a given type) of a node.

Parameters
oidThe oid of the node to find the parent for
typeThe type of the parent to find (if null the next parent of any type is returned)
buildDepthOne of the constants BUILDDEPTH_SINGLE (direct parent), BUILDDEPTH_GROUPED (group parent) [default: BUILDDEPTH_SINGLE]
Returns
The oid of the found parent Node / null if not found

Definition at line 746 of file class.NodeToSingleTableMapper.php.

References BUILDDEPTH_GROUPED, BUILDDEPTH_SINGLE, PersistenceFacade\getInstance(), and WCMFException\throwEx().

+ Here is the call graph for this function:

Member Data Documentation

NodeToSingleTableMapper::$_conn = null

Definition at line 56 of file class.NodeToSingleTableMapper.php.

Referenced by getConnection().

NodeToSingleTableMapper::$_rootElementId = 0

Definition at line 57 of file class.NodeToSingleTableMapper.php.

NodeToSingleTableMapper::$_rootId = 0

Definition at line 58 of file class.NodeToSingleTableMapper.php.

NodeToSingleTableMapper::$_groupMap = array()

Definition at line 59 of file class.NodeToSingleTableMapper.php.

NodeToSingleTableMapper::$_type = '*'

Definition at line 60 of file class.NodeToSingleTableMapper.php.

NodeToSingleTableMapper::$_dbPrefix = ''

Definition at line 61 of file class.NodeToSingleTableMapper.php.


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