protected function filterFields(array $data): array
    {
        $fields = $this->getFilterFields();

        if ($fields === null) {
            return $data;
        }

        return array_intersect_key(
            $data,
            array_flip(
                iterator_to_array($fields)
            )
        );
    }
protected function filterFields(array $data): array
    {
        $fields = $this->getFilterFields();

        if ($fields === null) {
            return $data;
        }

        return array_intersect_key(
            $data,
            array_flip(
                iterator_to_array($fields)
            )
        );
    }
protected function filterFields ( array $ data ) : array { $ fields = $ this -> getFilterFields ( ) ; if ( $ fields === null ) { return $ data ; } return array_intersect_key ( $ data , array_flip ( iterator_to_array ( $ fields ) ) ) ; }
Filter the provided data with the requested filter fields for
the scope resource

@param array $data

@return array
Filter the provided data with the requested filter fields for the scope resource