Subversion Repositories Applications.papyrus

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1173 jp_milcent 1
<?php
2
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */
3
 
4
/**
5
 * Contains the DB_QueryTool_Result_Row and DB_QueryTool_Result_Object classes
6
 *
7
 * PHP versions 4 and 5
8
 *
9
 * LICENSE: This source file is subject to version 3.0 of the PHP license
10
 * that is available through the world-wide-web at the following URI:
11
 * http://www.php.net/license/3_0.txt.  If you did not receive a copy of
12
 * the PHP License and are unable to obtain it through the web, please
13
 * send a note to license@php.net so we can mail you a copy immediately.
14
 *
15
 * @category   Database
16
 * @package    DB_QueryTool
17
 * @author     Roman Dostovalov, Com-tec-so S.A.<roman.dostovalov@ctco.lv>
18
 * @copyright  2004-2005 Roman Dostovalov
19
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
20
 * @version    CVS: $Id: Object.php,v 1.1 2006-12-14 15:04:29 jp_milcent Exp $
21
 * @link       http://pear.php.net/package/DB_QueryTool
22
 */
23
 
24
/**
25
 * Include parent class
26
 */
27
require_once 'DB/QueryTool/Result.php';
28
 
29
/**
30
 * DB_QueryTool_Result_Row class
31
 *
32
 * @category   Database
33
 * @package    DB_QueryTool
34
 * @author     Roman Dostovalov, Com-tec-so S.A.<roman.dostovalov@ctco.lv>
35
 * @copyright  2004-2005 Roman Dostovalov
36
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
37
 * @link       http://pear.php.net/package/DB_QueryTool
38
 */
39
class DB_QueryTool_Result_Row
40
{
41
	/**
42
	 * create object properties from the array
43
	 * @param array
44
	 */
45
	function DB_QueryTool_Result_Row($arr)
46
	{
47
        foreach ($arr as $key => $value) {
48
		    $this->$key = $value;
49
        }
50
	}
51
}
52
 
53
// -----------------------------------------------------------------------------
54
 
55
/**
56
 * DB_QueryTool_Result_Object class
57
 *
58
 * @category   Database
59
 * @package    DB_QueryTool
60
 * @author     Roman Dostovalov, Com-tec-so S.A.<roman.dostovalov@ctco.lv>
61
 * @copyright  2004-2005 Roman Dostovalov
62
 * @license    http://www.php.net/license/3_0.txt  PHP License 3.0
63
 * @link       http://pear.php.net/package/DB_QueryTool
64
 */
65
class DB_QueryTool_Result_Object extends DB_QueryTool_Result
66
{
67
    // {{{ fetchRow
68
 
69
	/**
70
	 * This function emulates PEAR::DB fetchRow() method
71
	 * With this function DB_QueryTool can transparently replace PEAR::DB
72
	 *
73
	 * @todo implement fetchmode support?
74
	 * @access    public
75
	 * @return    void
76
	 */
77
	function fetchRow()
78
	{
79
		$arr = $this->getNext();
80
		if (!PEAR::isError($arr)) {
81
		    $row = new DB_QueryTool_Result_Row($arr);
82
			return $row;
83
		}
84
		return false;
85
	}
86
 
87
	// }}}
88
}
89
?>