Galleries\Controller\Api::find PHP Method

find() public method

public find ( )
    public function find()
    {
        $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;
        }
        $docs = $this->app->db->find("common/galleries", $options);
        return json_encode($docs->toArray());
    }