Example #1
0
 function __construct($mdel)
 {
     if ($mdel) {
         $this->id = $mdel;
         $this->name = $this->getModelName($mdel);
     }
     R::ext('xdispense', function ($type) {
         return R::getRedBean()->dispense($type);
     });
 }
Example #2
0
 /**
  * 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();
     }
 }