1 |
<?php |
2 |
/** |
3 |
* This file contains the DataSource::Adapter::phpHtmlLib::DataListSource |
4 |
* adapter class that inherits from the DataListSource. |
5 |
* |
6 |
* @author Andreas Motl <andreas.motl@ilo.de> |
7 |
* @package org.netfrag.glib |
8 |
* @name DataSource::Adapter::phpHtmlLib::DataListSource |
9 |
* |
10 |
*/ |
11 |
|
12 |
/** |
13 |
* <b>Cvs-Log:</b> |
14 |
* |
15 |
* <pre> |
16 |
* $Id: DataListSource.php,v 1.3 2003/03/11 01:22:26 joko Exp $ |
17 |
* |
18 |
* $Log: DataListSource.php,v $ |
19 |
* Revision 1.3 2003/03/11 01:22:26 joko |
20 |
* + fixed metadata for phpDocumentor |
21 |
* |
22 |
* Revision 1.2 2003/03/05 18:54:45 joko |
23 |
* updated docu - phpDocumentor is very strict about its 'blocks'... |
24 |
* |
25 |
* Revision 1.1 2003/03/05 12:06:23 joko |
26 |
* + initial commit |
27 |
* </pre> |
28 |
* |
29 |
*/ |
30 |
|
31 |
|
32 |
|
33 |
/** |
34 |
* This file contains the DataSource::Adapter::phpHtmlLib::DataListSource |
35 |
* adapter class that inherits from the DataListSource. |
36 |
* |
37 |
* @author Andreas Motl <andreas.motl@ilo.de> |
38 |
* @copyright (c) 2003 - All Rights reserved. |
39 |
* @license GNU LGPL (GNU Lesser General Public License) |
40 |
* |
41 |
* @link http://www.netfrag.org/~joko/ |
42 |
* @link http://www.gnu.org/licenses/lgpl.txt |
43 |
* |
44 |
* @package org.netfrag.glib |
45 |
* @subpackage DataSource |
46 |
* @name DataSource::Adapter::phpHtmlLib::DataListSource |
47 |
* |
48 |
*/ |
49 |
class DataSource_Adapter_phpHtmlLib_DataSource extends MemoryDataSource { |
50 |
|
51 |
/** |
52 |
* The constructor. |
53 |
* |
54 |
* @param DesignPattern::Proxy - a Proxy instance |
55 |
* |
56 |
*/ |
57 |
function DataSource_Adapter_phpHtmlLib_DataSource(&$proxy) { |
58 |
|
59 |
if (!isset($proxy)) { |
60 |
user_error("Please pass Proxy instance to the Adapter!"); |
61 |
return; |
62 |
} |
63 |
|
64 |
$this->_proxy = &$proxy; |
65 |
|
66 |
// tracing |
67 |
//$this->trace_payload('DataSource_Adapter_phpHtmlLib_DataListSource', $proxy); |
68 |
|
69 |
// transfer data to "memory" |
70 |
//$this->_memory = &$payload; |
71 |
|
72 |
//return 1; |
73 |
|
74 |
} |
75 |
|
76 |
function fetch($force = 0) { |
77 |
$this->_result = $this->_proxy->get_result(); |
78 |
//print "size: " . sizeof($this->_result) . "<br/>"; |
79 |
if (!sizeof($this->_result) || $force) { |
80 |
$this->_result = $this->_proxy->query_data(); |
81 |
} |
82 |
$this->propagate(); |
83 |
} |
84 |
|
85 |
function propagate() { |
86 |
$this->handle_result(); |
87 |
} |
88 |
|
89 |
|
90 |
|
91 |
function get_header() { |
92 |
$this->fetch(); |
93 |
$this->read_labels_from_result(); |
94 |
return $this->get_labels(); |
95 |
} |
96 |
|
97 |
function do_prequery() { |
98 |
} |
99 |
|
100 |
function do_query() { |
101 |
$this->fetch(); |
102 |
} |
103 |
|
104 |
} |
105 |
|
106 |
?> |