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