| 1 |
lars |
1 |
<?php
|
|
|
2 |
/**
|
|
|
3 |
* This file contains the class XML_Query2XML_Data.
|
|
|
4 |
*
|
|
|
5 |
* PHP version 5
|
|
|
6 |
*
|
|
|
7 |
* @category XML
|
|
|
8 |
* @package XML_Query2XML
|
|
|
9 |
* @author Lukas Feiler <lukas.feiler@lukasfeiler.com>
|
|
|
10 |
* @copyright 2009 Lukas Feiler
|
|
|
11 |
* @license http://www.gnu.org/copyleft/lesser.html LGPL Version 2.1
|
|
|
12 |
* @version CVS: $Id: Data.php 276639 2009-03-01 13:17:08Z lukasfeiler $
|
|
|
13 |
* @link http://pear.php.net/package/XML_Query2XML
|
|
|
14 |
* @access private
|
|
|
15 |
*/
|
|
|
16 |
|
|
|
17 |
/**
|
|
|
18 |
* XML_Query2XML_Data implements the interface XML_Query2XML_Callback.
|
|
|
19 |
*/
|
|
|
20 |
require_once 'XML/Query2XML/Callback.php';
|
|
|
21 |
|
|
|
22 |
/**
|
|
|
23 |
* Abstract class extended by all Data classes.
|
|
|
24 |
*
|
|
|
25 |
* @category XML
|
|
|
26 |
* @package XML_Query2XML
|
|
|
27 |
* @author Lukas Feiler <lukas.feiler@lukasfeiler.com>
|
|
|
28 |
* @copyright 2009 Lukas Feiler
|
|
|
29 |
* @license http://www.gnu.org/copyleft/lesser.html LGPL Version 2.1
|
|
|
30 |
* @version Release: 1.7.2
|
|
|
31 |
* @link http://pear.php.net/package/XML_Query2XML
|
|
|
32 |
* @access private
|
|
|
33 |
* @since Release 1.7.1RC1
|
|
|
34 |
*/
|
|
|
35 |
abstract class XML_Query2XML_Data implements XML_Query2XML_Callback
|
|
|
36 |
{
|
|
|
37 |
/**
|
|
|
38 |
* The configuration path; it is used for exception messages.
|
|
|
39 |
* @var string
|
|
|
40 |
*/
|
|
|
41 |
private $_configPath = '';
|
|
|
42 |
|
|
|
43 |
/**
|
|
|
44 |
* This method will be called by XML_Query2XML to create a new instance
|
|
|
45 |
* of a class extending this class.
|
|
|
46 |
*
|
|
|
47 |
* @param mixed $primaryArg The primary argument: if it's is a
|
|
|
48 |
* Data Processor or Condition Class this will
|
|
|
49 |
* be a preprocessor (i.e. an instance of
|
|
|
50 |
* XML_Query2XML_Data); if it's a Data Source
|
|
|
51 |
* this will most likely be a string.
|
|
|
52 |
* @param string $configPath The configuration path within the $options
|
|
|
53 |
* array.
|
|
|
54 |
*
|
|
|
55 |
* @return XML_Query2XML_Data_Processor
|
|
|
56 |
*/
|
|
|
57 |
public abstract function create($primaryArg, $configPath);
|
|
|
58 |
|
|
|
59 |
/**
|
|
|
60 |
* Returns the first pre-processor in the chain.
|
|
|
61 |
*
|
|
|
62 |
* @return XML_Query2XML_Data
|
|
|
63 |
*/
|
|
|
64 |
public abstract function getFirstPreProcessor();
|
|
|
65 |
|
|
|
66 |
/**
|
|
|
67 |
* Set the configuration path to be used for exception messages.
|
|
|
68 |
*
|
|
|
69 |
* @param string $configPath The configuration path.
|
|
|
70 |
*
|
|
|
71 |
* @return void
|
|
|
72 |
*/
|
|
|
73 |
protected function setConfigPath($configPath)
|
|
|
74 |
{
|
|
|
75 |
if ($configPath) {
|
|
|
76 |
$configPath .= ': ';
|
|
|
77 |
}
|
|
|
78 |
$this->_configPath = $configPath;
|
|
|
79 |
}
|
|
|
80 |
|
|
|
81 |
/**
|
|
|
82 |
* Return the configuration path to be used for exception messages.
|
|
|
83 |
*
|
|
|
84 |
* @return string The configuration path.
|
|
|
85 |
*/
|
|
|
86 |
protected function getConfigPath()
|
|
|
87 |
{
|
|
|
88 |
return $this->_configPath;
|
|
|
89 |
}
|
|
|
90 |
|
|
|
91 |
/**
|
|
|
92 |
* Returns a textual representation of this instance.
|
|
|
93 |
*
|
|
|
94 |
* @return string
|
|
|
95 |
*/
|
|
|
96 |
public abstract function toString();
|
|
|
97 |
}
|
|
|
98 |
?>
|