public function getIncludedInContext(Context $context, CurrentPath $path = null)
    {
        if (!isset($path)) {
            $path = new CurrentPath();
        }

        $out = new self();
        foreach ($this as $v) {
            /** @var $v Field */
            if ($v->shouldInclude($context, $path)) {
                $out[] = $v;
            }
        }

        return $out;
    }
public function getIncludedInContext(Context $context, CurrentPath $path = null)
    {
        if (!isset($path)) {
            $path = new CurrentPath();
        }

        $out = new self();
        foreach ($this as $v) {
            /** @var $v Field */
            if ($v->shouldInclude($context, $path)) {
                $out[] = $v;
            }
        }

        return $out;
    }
public function getIncludedInContext ( Context $ context , CurrentPath $ path = null ) { if ( ! isset ( $ path ) ) { $ path = new CurrentPath ( ) ; } $ out = new self ( ) ; foreach ( $ this as $ v ) { /** @var $v Field */ if ( $ v -> shouldInclude ( $ context , $ path ) ) { $ out [ ] = $ v ; } } return $ out ; }
Get all resource fields that should be included in a given context
@param Context $context
@param CurrentPath|null $path
@return array|ResourceFieldCollection
Get all resource fields that should be included in a given context