public function lock($document, $lockMode)
    {
        $qb          = $this->dm->createQueryBuilder($this->class->name);
        $identifier  = $this->uow->getDocumentIdentifier($document);
        $lockMapping = $this->class->lockMetadata;

        $qb->update();
        $qb->setIdentifier($identifier);

        $qb->attr($lockMapping->name)->set($lockMode);
        $qb->getQuery()->execute();

        $lockMapping->setValue($document, $lockMode);
    }
public function lock($document, $lockMode)
    {
        $qb          = $this->dm->createQueryBuilder($this->class->name);
        $identifier  = $this->uow->getDocumentIdentifier($document);
        $lockMapping = $this->class->lockMetadata;

        $qb->update();
        $qb->setIdentifier($identifier);

        $qb->attr($lockMapping->name)->set($lockMode);
        $qb->getQuery()->execute();

        $lockMapping->setValue($document, $lockMode);
    }
public function lock ( $ document , $ lockMode ) { $ qb = $ this -> dm -> createQueryBuilder ( $ this -> class -> name ) ; $ identifier = $ this -> uow -> getDocumentIdentifier ( $ document ) ; $ lockMapping = $ this -> class -> lockMetadata ; $ qb -> update ( ) ; $ qb -> setIdentifier ( $ identifier ) ; $ qb -> attr ( $ lockMapping -> name ) -> set ( $ lockMode ) ; $ qb -> getQuery ( ) -> execute ( ) ; $ lockMapping -> setValue ( $ document , $ lockMode ) ; }
Locks document by storing the lock mode on the mapped lock attribute.

@param object $document
@param int    $lockMode

@return void
Locks document by storing the lock mode on the mapped lock attribute .