/**
  * @param ApiResource $apiResource
  * @param array $searchParams
  * @param bool $public
  * @return array
  */
 private function getParams(ApiResource $apiResource, $searchParams = [], $public = false)
 {
     if ($parentResource = $apiResource->getParentResource()) {
         $key = $public ? $apiResource->getAssocParent() : FilterDecorator::getFilterName($parentResource);
         $searchParams[$key] = $parentResource->getIdentifierValue();
         $searchParams = array_merge($searchParams, $this->getParams($parentResource, $searchParams, $public));
     }
     return $searchParams;
 }