May 9th — v7.0.0-rc.3
Version 7 will be released soon. Read the v7 docs

Resource::getParent

Returns the parent Resource of a child resource.

resource.getParent()

If the resource does not have a parent because it is already a top-level resource, the result will be null.