5 use RedBeanPHP\OODB as OODB;
6 use RedBeanPHP\QueryWriter as QueryWriter;
7 use RedBeanPHP\Adapter\DBAdapter as DBAdapter;
8 use RedBeanPHP\Adapter as Adapter;
13 * The toolbox is an integral part of RedBeanPHP providing the basic
14 * architectural building blocks to manager objects, helpers and additional tools
15 * like plugins. A toolbox contains the three core components of RedBeanPHP:
16 * the adapter, the query writer and the core functionality of RedBeanPHP in
19 * @file RedBeanPHP/ToolBox.php
20 * @author Gabor de Mooij and the RedBeanPHP community
24 * copyright (c) G.J.G.T. (Gabor) de Mooij and the RedBeanPHP Community.
25 * This source file is subject to the BSD/GPLv2 License that is bundled
26 * with this source code in the file license.txt.
47 * The toolbox is an integral part of RedBeanPHP providing the basic
48 * architectural building blocks to manager objects, helpers and additional tools
49 * like plugins. A toolbox contains the three core components of RedBeanPHP:
50 * the adapter, the query writer and the core functionality of RedBeanPHP in
53 * @param OODB $oodb Object Database, OODB
54 * @param DBAdapter $adapter Database Adapter
55 * @param QueryWriter $writer Query Writer
57 public function __construct( OODB $oodb, Adapter $adapter, QueryWriter $writer )
60 $this->adapter = $adapter;
61 $this->writer = $writer;
66 * Returns the query writer in this toolbox.
67 * The Query Writer is responsible for building the queries for a
68 * specific database and executing them through the adapter.
72 public function getWriter()
78 * Returns the OODB instance in this toolbox.
79 * OODB is responsible for creating, storing, retrieving and deleting
80 * single beans. Other components rely
81 * on OODB for their basic functionality.
85 public function getRedBean()
91 * Returns the database adapter in this toolbox.
92 * The adapter is responsible for executing the query and binding the values.
93 * The adapter also takes care of transaction handling.
97 public function getDatabaseAdapter()
99 return $this->adapter;