wCMF
3.6
|
Public Member Functions | |
NodeXMLMapper ($params) | |
& | load ($oid, $buildDepth) |
& | create ($type, $buildDepth) |
save (&$node) | |
delete ($oid, $recursive=true) | |
startTransaction () | |
commitTransaction () | |
rollbackTransaction () | |
getNextInsertId () | |
parseStartTag ($parser, $name, $attribs) | |
parseEndTag ($parser, $name) | |
parseElement ($parser, $data) | |
isDepthValid () | |
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 | |
$_filename = '' | |
$_doctype = '' | |
$_dtd = '' | |
$_root = null | |
$_prevId = -1 | |
$_curParent = null | |
$_curNode = null | |
$_startId = null | |
$_buildDepth = 0 | |
$_curDepth = -1 | |
$_startDepth = -1 | |
$_saveTree = null | |
$_loading = false | |
$_intransaction = false | |
Public Attributes inherited from PersistenceMapper | |
$_dataConverter = null | |
$_type = '' | |
$_logging = false | |
$_logStrategy = null | |
NodeXMLMapper maps nodes to a xml file.
Definition at line 53 of file class.NodeXMLMapper.php.
NodeXMLMapper::NodeXMLMapper | ( | $params | ) |
Constructor.
params | Initialization data given in an assoziative array with the following keys: filename, doctype, dtd |
Definition at line 78 of file class.NodeXMLMapper.php.
Referenced by getNextInsertId(), and startTransaction().
& NodeXMLMapper::load | ( | $oid, | |
$buildDepth | |||
) |
Construct a Node from the xml file.
oid | Id of the Node to construct |
buildDepth | One of the BUILDDEPTH constants or a number describing the number of generations to build |
Definition at line 90 of file class.NodeXMLMapper.php.
References $_root, BUILDDEPTH_SINGLE, STATE_CLEAN, and WCMFException\throwEx().
& NodeXMLMapper::create | ( | $type, | |
$buildDepth | |||
) |
Construct the template of a Node (defined by element name).
type | The element's type |
buildDepth | One of the BUILDDEPTH constants or a number describing the number of generations to build |
Definition at line 133 of file class.NodeXMLMapper.php.
References DATATYPE_ATTRIBUTE, and DATATYPE_ELEMENT.
Referenced by parseStartTag().
NodeXMLMapper::save | ( | & | $node | ) |
Save a Node to the xml file (inserted if it is new).
node | A reference to the Node to safe |
Definition at line 167 of file class.NodeXMLMapper.php.
References ADDCHILD_FRONT, DATATYPE_ATTRIBUTE, getNextInsertId(), NEXTID_NODE, STATE_CLEAN, STATE_DIRTY, and STATE_NEW.
NodeXMLMapper::delete | ( | $oid, | |
$recursive = true |
|||
) |
Delete a Node from the xml file (together with all of its children).
oid | The database id of the Node to delete |
recursive | True/False whether to physically delete it's children too [default: true] |
Definition at line 253 of file class.NodeXMLMapper.php.
NodeXMLMapper::startTransaction | ( | ) |
Definition at line 285 of file class.NodeXMLMapper.php.
References BUILDDEPTH_INFINITE, and NodeXMLMapper().
NodeXMLMapper::commitTransaction | ( | ) |
Definition at line 297 of file class.NodeXMLMapper.php.
NodeXMLMapper::rollbackTransaction | ( | ) |
Definition at line 324 of file class.NodeXMLMapper.php.
NodeXMLMapper::getNextInsertId | ( | ) |
Get the next insert id.
Definition at line 331 of file class.NodeXMLMapper.php.
References BUILDDEPTH_SINGLE, DATATYPE_ATTRIBUTE, NEXTID_NODE, and NodeXMLMapper().
Referenced by save().
NodeXMLMapper::parseStartTag | ( | $parser, | |
$name, | |||
$attribs | |||
) |
XML parser functions. Start Element Handler.
parser | A reference to the XML parser calling the handler |
name | The name of the element for which this handler is called |
attribs | An associative array with the element's attributes |
Definition at line 368 of file class.NodeXMLMapper.php.
References $_curDepth, BUILDDEPTH_SINGLE, create(), DATATYPE_ATTRIBUTE, and isDepthValid().
NodeXMLMapper::parseEndTag | ( | $parser, | |
$name | |||
) |
End Element Handler.
parser | A reference to the XML parser calling the handler |
name | The name of the element for which this handler is called |
Definition at line 411 of file class.NodeXMLMapper.php.
References isDepthValid().
NodeXMLMapper::parseElement | ( | $parser, | |
$data | |||
) |
Element Handler.
parser | A reference to the XML parser calling the handler |
data | The character data as a string |
Definition at line 429 of file class.NodeXMLMapper.php.
References DATATYPE_ELEMENT, and isDepthValid().
NodeXMLMapper::isDepthValid | ( | ) |
Check if the current depth is valid for building.
Definition at line 442 of file class.NodeXMLMapper.php.
References BUILDDEPTH_INFINITE.
Referenced by parseElement(), parseEndTag(), and parseStartTag().
NodeXMLMapper::$_filename = '' |
Definition at line 56 of file class.NodeXMLMapper.php.
NodeXMLMapper::$_doctype = '' |
Definition at line 57 of file class.NodeXMLMapper.php.
NodeXMLMapper::$_dtd = '' |
Definition at line 58 of file class.NodeXMLMapper.php.
NodeXMLMapper::$_root = null |
Definition at line 60 of file class.NodeXMLMapper.php.
Referenced by load().
NodeXMLMapper::$_prevId = -1 |
Definition at line 61 of file class.NodeXMLMapper.php.
NodeXMLMapper::$_curParent = null |
Definition at line 62 of file class.NodeXMLMapper.php.
NodeXMLMapper::$_curNode = null |
Definition at line 63 of file class.NodeXMLMapper.php.
NodeXMLMapper::$_startId = null |
Definition at line 64 of file class.NodeXMLMapper.php.
NodeXMLMapper::$_buildDepth = 0 |
Definition at line 65 of file class.NodeXMLMapper.php.
NodeXMLMapper::$_curDepth = -1 |
Definition at line 66 of file class.NodeXMLMapper.php.
Referenced by parseStartTag().
NodeXMLMapper::$_startDepth = -1 |
Definition at line 67 of file class.NodeXMLMapper.php.
NodeXMLMapper::$_saveTree = null |
Definition at line 68 of file class.NodeXMLMapper.php.
NodeXMLMapper::$_loading = false |
Definition at line 70 of file class.NodeXMLMapper.php.
NodeXMLMapper::$_intransaction = false |
Definition at line 71 of file class.NodeXMLMapper.php.