Datastore\Controller\Api::entries PHP Метод

entries() публичный Метод

public entries ( )
    public function entries()
    {
        $datastore = $this->param("table", null);
        $entries = [];
        if ($datastore) {
            $collection = "datastore" . $datastore["_id"];
            $options = [];
            if ($filter = $this->param("filter", null)) {
                $options["filter"] = $filter;
            }
            if ($limit = $this->param("limit", null)) {
                $options["limit"] = $limit;
            }
            if ($sort = $this->param("sort", null)) {
                $options["sort"] = $sort;
            }
            if ($skip = $this->param("skip", null)) {
                $options["skip"] = $skip;
            }
            $entries = $this->app->db->find("datastore/{$collection}", $options);
        }
        return json_encode($entries->toArray());
    }