original_string: protected function setDefaultRelations($service, $resource, &$params)
      {
          $api = $service . '/' . $resource;
          $relations = array_get($this->defaultRelation, $api);
          if (!empty($relations)) {
              $this->fixDefaultRelations($relations);
              if (!isset($params['related'])) {
                  $params['related'] = implode(',', $relations);
              } else {
                  foreach ($relations as $relation) {
                      if (strpos($params['related'], $relation) === false) {
                          $params['related'] .= ',' . $relation;
                      }
                  }
              }
          }
      }
code: protected function setDefaultRelations($service, $resource, &$params)
      {
          $api = $service . '/' . $resource;
          $relations = array_get($this->defaultRelation, $api);
          if (!empty($relations)) {
              $this->fixDefaultRelations($relations);
              if (!isset($params['related'])) {
                  $params['related'] = implode(',', $relations);
              } else {
                  foreach ($relations as $relation) {
                      if (strpos($params['related'], $relation) === false) {
                          $params['related'] .= ',' . $relation;
                      }
                  }
              }
          }
      }
code_tokens: protected function setDefaultRelations ( $ service , $ resource , & $ params ) { $ api = $ service . '/' . $ resource ; $ relations = array_get ( $ this -> defaultRelation , $ api ) ; if ( ! empty ( $ relations ) ) { $ this -> fixDefaultRelations ( $ relations ) ; if ( ! isset ( $ params [ 'related' ] ) ) { $ params [ 'related' ] = implode ( ',' , $ relations ) ; } else { foreach ( $ relations as $ relation ) { if ( strpos ( $ params [ 'related' ] , $ relation ) === false ) { $ params [ 'related' ] .= ',' . $ relation ; } } } } }
docstring: Sets the default relations to extract for some resources.
  
  @param string $service
  @param string $resource
  @param array  $params
docstring_tokens: Sets the default relations to extract for some resources .