function __construct($mdel) { if ($mdel) { $this->id = $mdel; $this->name = $this->getModelName($mdel); } R::ext('xdispense', function ($type) { return R::getRedBean()->dispense($type); }); }