Documentation is available at RSDApplication.php
1 <?php
2 // RSDEngine: The Rapid and Secure Development Engine
3 // Copyright (C) 2003 Lukas Feiler
4 //
5 // This library is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation; either
8 // version 2.1 of the License, or (at your option) any later version.
9 //
10 // This library is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // Lesser General Public License for more details.
14 //
15 // You should have received a copy of the GNU Lesser General Public
16 // License along with this library; if not, write to the Free Software
17 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18
19 /**This file is part of RSD - Rapid and Secure Development.
20 *
21 * @author Lukas Feiler
22 * @copyright Lukas Feiler 2003
23 * @package RSDEngine
24 * @version 0.1.9
25 * @filesource
26 */
27
28 /**RSDApplication extends PEAR.
29 */
30 require_once('PEAR.php');
31
32 /**RSDApplication is the base class for any application class.
33 *
34 * It holds handles to all objects used in this application.
35 * It can be used as the only entry point to the whole application!
36 * @author Lukas Feiler
37 * @copyright Lukas Feiler 2003
38 * @package RSDEngine
39 */
40 class RSDApplication extends PEAR {
41 /**Associative array that holds handels to all RSDTable object created. The table name is used as the key.
42 * @access private
43 * @var Array
44 */
45 var $_tables = array();
46
47 /**An instance of PEAR::DB
48 * @var DB
49 */
50 var $db = null;
51
52 /**An instance of RSErrorManager (or a child class).
53 * @var RSErrorManager
54 */
55 var $errorManager = null;
56
57 /**An instance of PEAR::Auth.
58 * @var Auth
59 */
60 var $auth = null;
61
62 /**An instance of Smarty.
63 * @var Smarty
64 */
65 var $smarty;
66
67 /**The constructor initializes the field db and errorManager.
68 * @param DB $db An instance of the class PEAR::DB
69 * @param RSErrorManager $errorManager An instance of the class RSErrorManager
70 * @see RSErrorManager
71 */
72 function RSDApplication($db,&$errorManager)
73 {
74 $this->db = &$db;
75 if (method_exists($db, "setFetchMode")) {
76 $this->db->setFetchMode(DB_FETCHMODE_ASSOC);
77 }
78 $this->errorManager = &$errorManager;
79 }
80 /**This method adds the table object passed as argument to the array $this->_tables.
81 * @param table An instance of an RSDTable child class.
82 */
83 function addTable(&$table)
84 {
85 if (!isset($this->_tables[$table->name])) {
86 $this->_tables[$table->name] =& $table;
87 }
88 }
89
90 function &getTable($tableName)
91 {
92 return $this->_tables[$tableName];
93 }
94 }
95 ?>
Documentation generated on Mon, 8 Dec 2003 13:10:39 +0100 by phpDocumentor 1.2.3