Skip to content

Nette database #20

Description

@rumcais

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
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions