Open Monograph Press  1.1
 All Classes Namespaces Functions Variables Groups Pages
DBDataXMLParser Class Reference

Public Member Functions

 _getFieldData ($fieldNode)
 
 DBDataXMLParser ()
 
 executeData ($continueOnError=false)
 
 getSQL ()
 
 parseData ($file)
 
 quoteString ($str)
 
 setDBConn (&$dbconn)
 

Public Attributes

 $dbconn
 
 $sql
 

Detailed Description

Class to import and export database data from an XML format. See dbscripts/xml/dtd/xmldata.dtd for the XML schema used.

Definition at line 20 of file DBDataXMLParser.inc.php.

Member Function Documentation

DBDataXMLParser::_getFieldData (   $fieldNode)

retrieve a field name and value from a field node

Parameters
$fieldNodeXMLNode
Returns
array an array with two entries: the field name and the field value

Definition at line 226 of file DBDataXMLParser.inc.php.

Referenced by parseData().

DBDataXMLParser::DBDataXMLParser ( )

Constructor.

Definition at line 36 of file DBDataXMLParser.inc.php.

DBDataXMLParser::executeData (   $continueOnError = false)

Execute the parsed SQL statements.

Parameters
$continueOnErrorboolean continue to execute remaining statements if a failure occurs
Returns
boolean success

Definition at line 187 of file DBDataXMLParser.inc.php.

DBDataXMLParser::getSQL ( )

Return the parsed SQL statements.

Returns
array

Definition at line 203 of file DBDataXMLParser.inc.php.

DBDataXMLParser::parseData (   $file)

Parse an XML data file into SQL statements.

Parameters
$filestring path to the XML file to parse
Returns
array the array of SQL statements parsed

Definition at line 54 of file DBDataXMLParser.inc.php.

References _getFieldData().

DBDataXMLParser::quoteString (   $str)

Quote a string to be appear as a value in an SQL INSERT statement.

Parameters
$strstring
Returns
string

Definition at line 212 of file DBDataXMLParser.inc.php.

DBDataXMLParser::setDBConn ( $dbconn)

Set the database connection to use for executeData(). If the connection is not set, the default system database connection will be used.

Parameters
$dbconnADOConnection the database connection

Definition at line 45 of file DBDataXMLParser.inc.php.

Member Data Documentation

ADOConnection DBDataXMLParser::$dbconn

the underlying database connection

Definition at line 25 of file DBDataXMLParser.inc.php.

array DBDataXMLParser::$sql

the array of parsed SQL statements

Definition at line 31 of file DBDataXMLParser.inc.php.


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