/** * Constructor. * Creates a new instance of the Resty BeanCan Server. * If no toolbox is provided the Resty BeanCan Server object will * try to obtain the toolbox currently used by the RedBeanPHP facade. * If you use only the R-methods and not the advanced objects this should be fine. * * @param RedBean_ToolBox $toolbox (optional) */ public function __construct($toolbox = NULL) { if ($toolbox instanceof RedBean_ToolBox) { $this->toolbox = $toolbox; $this->oodb = $toolbox->getRedBean(); } else { $this->toolbox = RedBean_Facade::getToolBox(); $this->oodb = RedBean_Facade::getRedBean(); } }