You are here

protected function ResourceFieldEntity::nestedDottedFilters in RESTful 7.2

Process the filter query string for the relevant sub-query.

Selects the filters that start with the field name.

Return value

array The processed filters.

1 call to ResourceFieldEntity::nestedDottedFilters()
ResourceFieldEntity::nestedDottedChildren in src/Plugin/resource/Field/ResourceFieldEntity.php
Get the children of a query string parameter that apply to the field.

File

src/Plugin/resource/Field/ResourceFieldEntity.php, line 572
Contains \Drupal\restful\Plugin\resource\Field\ResourceFieldEntity

Class

ResourceFieldEntity
Class ResourceFieldEntity.

Namespace

Drupal\restful\Plugin\resource\Field

Code

protected function nestedDottedFilters() {
  $input = $this
    ->getRequest()
    ->getParsedInput();
  if (empty($input['filter'])) {
    return array();
  }
  $output_filters = array();
  $filters = $input['filter'];
  foreach ($filters as $filter_public_name => $filter) {
    $filter = DataProvider::processFilterInput($filter, $filter_public_name);
    if (strpos($filter_public_name, $this
      ->getPublicName() . '.') === 0) {

      // Remove the prefix and add it to the filters for the next request.
      $new_name = substr($filter_public_name, strlen($this
        ->getPublicName()) + 1);
      $filter['public_field'] = $new_name;
      $output_filters[$new_name] = $filter;
    }
  }
  return $output_filters;
}