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

setVersionMapping() public method

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