public function getDocumentId($document, $throw = true)
    {
        $oid = is_object($document) ? spl_object_hash($document) : $document;
        if (empty($this->documentIds[$oid])) {
            if (!$throw) {
                return;
            }
            $msg = 'Document is not managed and has no id';
            if (is_object($document)) {
                $msg .= ': '.self::objToStr($document);
            }

            throw new PHPCRException($msg);
        }

        return $this->documentIds[$oid];
    }
public function getDocumentId($document, $throw = true)
    {
        $oid = is_object($document) ? spl_object_hash($document) : $document;
        if (empty($this->documentIds[$oid])) {
            if (!$throw) {
                return;
            }
            $msg = 'Document is not managed and has no id';
            if (is_object($document)) {
                $msg .= ': '.self::objToStr($document);
            }

            throw new PHPCRException($msg);
        }

        return $this->documentIds[$oid];
    }
public function getDocumentId ( $ document , $ throw = true ) { $ oid = is_object ( $ document ) ? spl_object_hash ( $ document ) : $ document ; if ( empty ( $ this -> documentIds [ $ oid ] ) ) { if ( ! $ throw ) { return ; } $ msg = 'Document is not managed and has no id' ; if ( is_object ( $ document ) ) { $ msg .= ': ' . self :: objToStr ( $ document ) ; } throw new PHPCRException ( $ msg ) ; } return $ this -> documentIds [ $ oid ] ; }
Get the object ID for the given document.

@param object|string $document document instance or document object hash

@throws PHPCRException

@return string|null
Get the object ID for the given document .