ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5
ilDomDocument Class Reference

Dom document wrapper. More...

+ Collaboration diagram for ilDomDocument:

Public Member Functions

 __construct ()
 Constructor. More...
 
 __call ($a_method, $a_args)
 Call. More...
 
 __get ($a_mem)
 Get. More...
 
 __set ($a_mem, $a_val)
 Set. More...
 
 handleError ($a_no, $a_string, $a_file=null, $a_line=null, $a_context=null)
 Handle error. More...
 

Private Attributes

 $doc
 
 $errors = array()
 

Detailed Description

Dom document wrapper.

Author
author alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$ /

Definition at line 11 of file class.ilDomDocument.php.

Constructor & Destructor Documentation

◆ __construct()

ilDomDocument::__construct ( )

Constructor.

Parameters
DOMDocumentPHP dom document

Definition at line 20 of file class.ilDomDocument.php.

21  {
22  $this->doc = new DOMDocument();
23  }

Member Function Documentation

◆ __call()

ilDomDocument::__call (   $a_method,
  $a_args 
)

Call.

Definition at line 28 of file class.ilDomDocument.php.

29  {
30  if (in_array($a_method, array("validate", "loadXML")))
31  {
32  set_error_handler(array($this, "handleError"));
33  $rv = call_user_func_array(array($this->doc, $a_method), $a_args);
34  restore_error_handler();
35  return $rv;
36  }
37  else
38  {
39  return call_user_func_array(array($this->doc, $a_method), $a_args);
40  }
41  }

◆ __get()

ilDomDocument::__get (   $a_mem)

Get.

Definition at line 46 of file class.ilDomDocument.php.

References $errors.

47  {
48  if ($a_mem == "errors")
49  {
50  return $this->errors;
51  }
52  else
53  {
54  return $this->doc->$a_mem;
55  }
56  }

◆ __set()

ilDomDocument::__set (   $a_mem,
  $a_val 
)

Set.

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

62  {
63  $this->_delegate->$a_mem = $a_val;
64  }

◆ handleError()

ilDomDocument::handleError (   $a_no,
  $a_string,
  $a_file = null,
  $a_line = null,
  $a_context = null 
)

Handle error.

Definition at line 69 of file class.ilDomDocument.php.

70  {
71  $pos = strpos($a_string, "]:");
72  $err = trim(substr($a_string, $pos + 2));
73  $this->errors[] = $err;
74  }

Field Documentation

◆ $doc

ilDomDocument::$doc
private

Definition at line 13 of file class.ilDomDocument.php.

◆ $errors

ilDomDocument::$errors = array()
private

Definition at line 14 of file class.ilDomDocument.php.

Referenced by __get().


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