-
Notifications
You must be signed in to change notification settings - Fork 10
Description
Potřeboval bych poradit jak použít jsonrpc2 s nette database. Na jiném projektu jsem používal knihovnu dibi. A s tou to fungovalo bez problému. Můj příklad:
$server = new \Lightbulb\Json\Rpc2\Server;
$server->situace = new SituaceHandler($this->kategorieModel);
class SituaceHandler {
public $kategorieModel;
function __construct($kategorieModel)
{
$this->kategorieModel=$kategorieModel;
}
public function sendAllCategory() {
$retval=$this->kategorieModel->getAllData()->order('position')->fetchAssoc('id');
$ret = new \stdClass();
$ret->result=$retval;
return $ret;
}
Server mi vrací:
response:
{
jsonrpc : 2.0,
error : {
code : 0,
message : fopen(/app/src/app/../temp/cache/_Nette.Database.f9984012521578c37f8a2419fc007bbe/_48509200295bca30224e85dbd33b9614): failed to open stream: No such file or directory\nin file /app/src/vendor/nette/caching/src/Caching/Storages/FileStorage.php\non line 298
},
id : 0
}