currentVersion ?? $this->version; } public function setVersion(int $version): void { $this->currentVersion = $version; $this->incrementVersion = false; } public function isMarkedForVersionIncrement(): bool { return $this->incrementVersion; } public function markForVersionIncrement(): void { $this->incrementVersion = true; } public function getVersionField(): string { return 'version'; } private static function addVersionField(ClassMetadataBuilder $builder): void { $builder->createField('version', Types::INTEGER) ->columnName('version') ->option('default', 1) ->option('unsigned', true) ->build(); } }