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;
                    }
                }
            }
        }
    }
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;
                    }
                }
            }
        }
    }
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 ; } } } } }
Sets the default relations to extract for some resources.

@param string $service
@param string $resource
@param array  $params
Sets the default relations to extract for some resources .