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

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
 

Detailed Description

NodeXMLMapper maps nodes to a xml file.

Deprecated:
Use NodeXMLDBMapper instead
Todo:
: add DataConverter, Logging
Author
ingo herwig ingo@.nosp@m.wemo.nosp@m.ve.co.nosp@m.m

Definition at line 53 of file class.NodeXMLMapper.php.

Member Function Documentation

NodeXMLMapper::NodeXMLMapper (   $params)

Constructor.

Parameters
paramsInitialization 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.

Parameters
oidId of the Node to construct
buildDepthOne of the BUILDDEPTH constants or a number describing the number of generations to build
Returns
A reference to the Node, null if oid does not exist.

Definition at line 90 of file class.NodeXMLMapper.php.

References $_root, BUILDDEPTH_SINGLE, STATE_CLEAN, and WCMFException\throwEx().

+ Here is the call graph for this function:

& NodeXMLMapper::create (   $type,
  $buildDepth 
)

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

Parameters
typeThe element's type
buildDepthOne of the BUILDDEPTH constants or a number describing the number of generations to build
Note
BUILDDEPTH is not supported yet!
Returns
A reference to the Node.

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).

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

Definition at line 167 of file class.NodeXMLMapper.php.

References ADDCHILD_FRONT, DATATYPE_ATTRIBUTE, getNextInsertId(), NEXTID_NODE, STATE_CLEAN, STATE_DIRTY, and STATE_NEW.

+ Here is the call graph for this function:

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

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

Parameters
oidThe database 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
Attention
recursive parameter is ignored here

Definition at line 253 of file class.NodeXMLMapper.php.

NodeXMLMapper::startTransaction ( )
See Also
PersistenceMapper::startTransaction() From now on all calls to save() and delete() will be executed to a temporary tree that will be saved by the call to commitTransaction().

Definition at line 285 of file class.NodeXMLMapper.php.

References BUILDDEPTH_INFINITE, and NodeXMLMapper().

+ Here is the call graph for this function:

NodeXMLMapper::commitTransaction ( )
See Also
PersistenceMapper::commitTransaction() Save the temporary tree.

Definition at line 297 of file class.NodeXMLMapper.php.

NodeXMLMapper::rollbackTransaction ( )
See Also
PersistenceMapper::rollbackTransaction() Nothing to do since the changes have to be explicitely committed.

Definition at line 324 of file class.NodeXMLMapper.php.

NodeXMLMapper::getNextInsertId ( )

Get the next insert id.

Returns
next insert id

Definition at line 331 of file class.NodeXMLMapper.php.

References BUILDDEPTH_SINGLE, DATATYPE_ATTRIBUTE, NEXTID_NODE, and NodeXMLMapper().

Referenced by save().

+ Here is the call graph for this function:

NodeXMLMapper::parseStartTag (   $parser,
  $name,
  $attribs 
)

XML parser functions. Start Element Handler.

Parameters
parserA reference to the XML parser calling the handler
nameThe name of the element for which this handler is called
attribsAn 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().

+ Here is the call graph for this function:

NodeXMLMapper::parseEndTag (   $parser,
  $name 
)

End Element Handler.

Parameters
parserA reference to the XML parser calling the handler
nameThe name of the element for which this handler is called

Definition at line 411 of file class.NodeXMLMapper.php.

References isDepthValid().

+ Here is the call graph for this function:

NodeXMLMapper::parseElement (   $parser,
  $data 
)

Element Handler.

Parameters
parserA reference to the XML parser calling the handler
dataThe character data as a string

Definition at line 429 of file class.NodeXMLMapper.php.

References DATATYPE_ELEMENT, and isDepthValid().

+ Here is the call graph for this function:

NodeXMLMapper::isDepthValid ( )

Check if the current depth is valid for building.

Returns
True/False whether the depth is valid

Definition at line 442 of file class.NodeXMLMapper.php.

References BUILDDEPTH_INFINITE.

Referenced by parseElement(), parseEndTag(), and parseStartTag().

Member Data Documentation

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.


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