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