Doctrine\ODM\MongoDB\Mapping\ClassMetadataInfo::setLockMapping PHP Method

setLockMapping() public method

Sets the version field mapping used for versioning. Sets the default value to use depending on the column type.
public setLockMapping ( array &$mapping )
$mapping array The version field mapping array
    public function setLockMapping(array &$mapping)
    {
        if ($mapping['type'] !== 'int') {
            throw LockException::invalidLockFieldType($mapping['type']);
        }
        $this->isLockable = true;
        $this->lockField = $mapping['fieldName'];
    }
ClassMetadataInfo