Skip to content

Commit

Permalink
Merge pull request #525 from bravo-kernel/filter
Browse files Browse the repository at this point in the history
Document JSON API Filtering (refs #524)
  • Loading branch information
ADmad authored Apr 26, 2017
2 parents 313e14c + b7be083 commit 70753e5
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions docs/listeners/jsonapi.rst
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,32 @@ This listener fully supports the ``API Query Log`` listener and will,
once enabled as `described here <https://crud.readthedocs.io/en/latest/listeners/api-query-log.html#setup>`_
, add a top-level ``query`` node to every response when debug mode is enabled.

Filtering
---------

To enable `JSON API Filtering <http://jsonapi.org/format/#fetching-filtering>`_
install and configure the
``Search`` listener as `described here <http://crud.readthedocs.io/en/latest/listeners/search.html>`_
and then simply use search aliases named ``filter`` like shown below:

.. code-block:: phpinline
public function searchConfiguration()
{
$search = new Manager($this);
$search->like('filter', [
'before' => true,
'after' => true,
'field' => [$this->aliasField('name')]
]);
return $search;
}
Please note that not
`all filtering options <https://github.com/FriendsOfCake/crud/issues/524`_
have been implemented yet.

Schemas
-------

Expand Down

0 comments on commit 70753e5

Please sign in to comment.