wCMF
3.6
|
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) | |
![]() | |
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 = '' | |
![]() | |
$_dataConverter = null | |
$_type = '' | |
$_logging = false | |
$_logStrategy = null | |
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.
Definition at line 54 of file class.NodeToSingleTableMapper.php.
NodeToSingleTableMapper::NodeToSingleTableMapper | ( | $params | ) |
Constructor.
params | Initialization 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().
& NodeToSingleTableMapper::load | ( | $oid, | |
$buildDepth, | |||
$buildType = BUILDTYPE_COMPLETE , |
|||
$depth = 0 |
|||
) |
Construct a Node from the database.
oid | The object id of the Node to load |
buildDepth | One of the BUILDDEPTH constants or a number describing the number of generations to build (except BUILDDEPTH_REQUIRED) |
buildType | One of the BUILDTYPE constants describing the size to build |
depth | Internal use |
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().
& NodeToSingleTableMapper::create | ( | $type, | |
$buildDepth, | |||
$buildType = BUILDTYPE_COMPLETE , |
|||
$depth = 0 |
|||
) |
Construct the template of a Node of a given type (defined by element name).
type | The type of the Node to construct (maybe '' for an unspecified Node) |
buildDepth | One of the BUILDDEPTH constants or a number describing the number of generations to build |
buildType | One of the BUILDTYPE constants describing the size to build |
depth | Internal use |
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().
NodeToSingleTableMapper::save | ( | & | $node | ) |
Save a Node to the database (inserted if it is new).
node | A reference to the Node to save |
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().
NodeToSingleTableMapper::delete | ( | $oid, | |
$recursive = true |
|||
) |
Delete a Node from the database (together with all of its children).
oid | The object id of the Node to delete |
recursive | True/False whether to physically delete it's children too [default: true] |
Definition at line 572 of file class.NodeToSingleTableMapper.php.
References BUILDDEPTH_SINGLE, PersistenceFacade\getInstance(), PersistenceMapper\isLogging(), PersistenceMapper\logAction(), and WCMFException\throwEx().
& NodeToSingleTableMapper::getConnection | ( | ) |
Get the database connection.
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.
childElementId | The element id of the child Node |
parentElementId | The element id of the parent Node (necessary to identify relation) |
rootElementId | The element id of the root Node |
Definition at line 622 of file class.NodeToSingleTableMapper.php.
NodeToSingleTableMapper::getOIDs | ( | $type, | |
$criteria = null |
|||
) |
Get the object ids of nodes matching a given criteria.
type | The type of the object |
criteria | An assoziative array holding name value pairs of attributes (maybe null). Values maybe substrings of values to search for. [default: null] |
Definition at line 645 of file class.NodeToSingleTableMapper.php.
References PersistenceFacade\getInstance(), and WCMFException\throwEx().
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').
type | The type of the node (e.g. 'contractor') |
property | The type of the child node (e.g. 'shortname'). If property is null the element of the type itself will be taken |
attribute | An assoziative array holding name value pairs of attributes (maybe null). Values maybe substrings of values to search for. [default: null] |
oid | If oid is given the property map will only be build for this single node [default: null] |
Definition at line 687 of file class.NodeToSingleTableMapper.php.
References PersistenceFacade\getInstance(), and WCMFException\throwEx().
NodeToSingleTableMapper::getParentOID | ( | $oid, | |
$type = null , |
|||
$buildDepth = BUILDDEPTH_SINGLE |
|||
) |
Get the object id of the (next) parent (of a given type) of a node.
oid | The oid of the node to find the parent for |
type | The type of the parent to find (if null the next parent of any type is returned) |
buildDepth | One of the constants BUILDDEPTH_SINGLE (direct parent), BUILDDEPTH_GROUPED (group parent) [default: BUILDDEPTH_SINGLE] |
Definition at line 746 of file class.NodeToSingleTableMapper.php.
References BUILDDEPTH_GROUPED, BUILDDEPTH_SINGLE, PersistenceFacade\getInstance(), and WCMFException\throwEx().
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.