public function getParent(): self
    {
        $parentPath = \dirname($this->getPath());

        if ($parentPath === '.') {
            throw new OutOfRangeException('Cannot get parent of root reference');
        }

        return new self($this->uri->withPath($parentPath), $this->apiClient, $this->validator);
    }
public function getParent(): self
    {
        $parentPath = \dirname($this->getPath());

        if ($parentPath === '.') {
            throw new OutOfRangeException('Cannot get parent of root reference');
        }

        return new self($this->uri->withPath($parentPath), $this->apiClient, $this->validator);
    }
public function getParent ( ) : self { $ parentPath = \ dirname ( $ this -> getPath ( ) ) ; if ( $ parentPath === '.' ) { throw new OutOfRangeException ( 'Cannot get parent of root reference' ) ; } return new self ( $ this -> uri -> withPath ( $ parentPath ) , $ this -> apiClient , $ this -> validator ) ; }
The parent location of a Reference.

@see https://firebase.google.com/docs/reference/js/firebase.database.Reference#parent

@throws OutOfRangeException if requested for the root Reference

@return Reference
The parent location of a Reference .