php - Apigility rest service - how to filter by a non unique column using db connected -
i have db-connected rest
service, , managed far total collection database
or single entity id
.
i can't find proper guide explain how utilize get
url parameters filter other fields, , how take illustration whether "like" or %%" or other operators matter.
this experience codeconnected services. ymmv..
retrieving url parameters - controller/resource class.
your controller needs retrieve them $this->getevent()
/** * fetch single entity id, query params */ public function fetch($entity_id) { // retrieve query parameters\ $queryparams = $this->getevent()->getqueryparams(); }
secondly , parameters approved on module.config.php create past validator/filter part of apigility. notice collection query whitelist
module.config.php
within service's module folder
'servicename\\v1\\rest\\servicename\\controller' => array( ... 'entity_http_methods' => array( 0 => 'get', 1 => 'patch', 2 => 'put', 3 => 'delete', ), 'collection_http_methods' => array( 0 => 'get', 1 => 'post', ), 'collection_query_whitelist' => array( 0 => 'username', 1 => 'entity_provider', 2 => 'entity_type', 3 => 'entity_date_range', 4 => 'sort_by', 5 => 'sort_order' ), ...
php rest zend-framework2 apigility
No comments:
Post a Comment