protected function getIdentifier($reference, $uow)
    {
        // In case Reference is not yet managed in UnitOfWork
        if ( ! $this->hasIdentifier($reference)) {
            $class = $this->manager->getClassMetadata(get_class($reference));

            return $class->getIdentifierValues($reference);
        }

        // Dealing with ORM UnitOfWork
        if (method_exists($uow, 'getEntityIdentifier')) {
            return $uow->getEntityIdentifier($reference);
        }

        // PHPCR ODM UnitOfWork
        if ($this->manager instanceof PhpcrDocumentManager) {
            return $uow->getDocumentId($reference);
        }

        // ODM UnitOfWork
        return $uow->getDocumentIdentifier($reference);
    }
protected function getIdentifier($reference, $uow)
    {
        // In case Reference is not yet managed in UnitOfWork
        if ( ! $this->hasIdentifier($reference)) {
            $class = $this->manager->getClassMetadata(get_class($reference));

            return $class->getIdentifierValues($reference);
        }

        // Dealing with ORM UnitOfWork
        if (method_exists($uow, 'getEntityIdentifier')) {
            return $uow->getEntityIdentifier($reference);
        }

        // PHPCR ODM UnitOfWork
        if ($this->manager instanceof PhpcrDocumentManager) {
            return $uow->getDocumentId($reference);
        }

        // ODM UnitOfWork
        return $uow->getDocumentIdentifier($reference);
    }
protected function getIdentifier ( $ reference , $ uow ) { // In case Reference is not yet managed in UnitOfWork if ( ! $ this -> hasIdentifier ( $ reference ) ) { $ class = $ this -> manager -> getClassMetadata ( get_class ( $ reference ) ) ; return $ class -> getIdentifierValues ( $ reference ) ; } // Dealing with ORM UnitOfWork if ( method_exists ( $ uow , 'getEntityIdentifier' ) ) { return $ uow -> getEntityIdentifier ( $ reference ) ; } // PHPCR ODM UnitOfWork if ( $ this -> manager instanceof PhpcrDocumentManager ) { return $ uow -> getDocumentId ( $ reference ) ; } // ODM UnitOfWork return $ uow -> getDocumentIdentifier ( $ reference ) ; }
Get identifier for a unit of work

@param object $reference Reference object
@param object $uow       Unit of work

@return array
Get identifier for a unit of work