-
Notifications
You must be signed in to change notification settings - Fork 280
/
ToolBox.php
executable file
·66 lines (66 loc) · 1.52 KB
/
ToolBox.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
/**
* ToolBox
*
* @file RedBean/ToolBox.php
* @desc A RedBeanPHP-wide service locator
* @author Gabor de Mooij and the RedBeanPHP community
* @license BSD/GPLv2
*
* copyright (c) G.J.G.T. (Gabor) de Mooij and the RedBeanPHP Community.
* This source file is subject to the BSD/GPLv2 License that is bundled
* with this source code in the file license.txt.
*/
class RedBean_ToolBox {
/**
* @var RedBean_OODB
*/
protected $oodb;
/**
* @var RedBean_QueryWriter
*/
protected $writer;
/**
* @var RedBean_Adapter_DBAdapter
*/
protected $adapter;
/**
* Constructor.
*
* @param RedBean_OODB $oodb Object Database
* @param RedBean_Adapter_DBAdapter $adapter Adapter
* @param RedBean_QueryWriter $writer Writer
*
* return RedBean_ToolBox $toolbox Toolbox
*/
public function __construct(RedBean_OODB $oodb, RedBean_Adapter $adapter, RedBean_QueryWriter $writer) {
$this->oodb = $oodb;
$this->adapter = $adapter;
$this->writer = $writer;
return $this;
}
/**
* Returns the query writer in this toolbox.
*
* @return RedBean_QueryWriter $writer writer
*/
public function getWriter() {
return $this->writer;
}
/**
* Returns the OODB instance in this toolbox.
*
* @return RedBean_OODB $oodb Object Database
*/
public function getRedBean() {
return $this->oodb;
}
/**
* Returns the database adapter in this toolbox.
*
* @return RedBean_Adapter_DBAdapter $adapter Adapter
*/
public function getDatabaseAdapter() {
return $this->adapter;
}
}