This action will be executed on the activation of the module

@param string $versionNumber
@param string $oldVersionNumber
971430
public function activate($versionNumber, $oldVersionNumber = '')
    {
        $runtimeManager = $this->framework->getRuntimeManager();
        $runtimeManager->addFilterHandler('\\Zepi\\Core\\AccessControl\\Filter\\AccessLevelManager\\RemoveAccessLevel', '\\Zepi\\Core\\AccessControl\\FilterHandler\\RevokePermissionsForRemovedAccessLevel');
        $runtimeManager->addFilterHandler('\\Zepi\\Turbo\\Filter\\VerifyEventName', '\\Zepi\\Core\\AccessControl\\FilterHandler\\CheckEventAccessForSession');
        
        $runtimeManager->addEventHandler('\\Zepi\\Core\\AccessControl\\Event\\RedirectRequestWithoutSession', '\\Zepi\\Core\\AccessControl\\EventHandler\\RedirectRequestWithoutSession');
        $runtimeManager->addEventHandler('\\Zepi\\Core\\AccessControl\\Event\\DisplayNoAccessMessage', '\\Zepi\\Core\\AccessControl\\EventHandler\\DisplayNoAccessMessage');
        
        // Data Sources
        $dataSourceManager = $this->framework->getDataSourceManager();
        $dataSourceManager->addDataSource(
            '\\Zepi\\Core\\AccessControl\\DataSource\\AccessEntitiesDataSourceInterface',
            '\\Zepi\\DataSource\\Doctrine',
            '\\Zepi\\Core\\AccessControl\\DataSource\\AccessEntitiesDataSourceDoctrine'
        );
        
        $dataSourceManager->addDataSource(
            '\\Zepi\\Core\\AccessControl\\DataSource\\PermissionsDataSourceInterface',
            '\\Zepi\\DataSource\\Doctrine',
            '\\Zepi\\Core\\AccessControl\\DataSource\\PermissionsDataSourceDoctrine'
        );
        
        // Access Levels
        $accessLevelsManager = $this->framework->getInstance('\\Zepi\\Core\\AccessControl\\Manager\\AccessLevelManager');
        $accessLevelsManager->addAccessLevel(new \Zepi\Core\AccessControl\Entity\AccessLevel(
            '\\Global\\*',
            'Global Super User',
            'Super user privileges. Can do everything.',
            '\\Zepi\\Core\\AccessControl'
        ));
        
        $accessLevelsManager->addAccessLevel(new \Zepi\Core\AccessControl\Entity\AccessLevel(
            '\\Global\\Disabled',
            'Disabled User',
            'A disabled user. Can do nothing, not even login.',
            '\\Zepi\\Core\\AccessControl'
        ));
        
        $accessLevelsManager->addAccessLevel(new \Zepi\Core\AccessControl\Entity\AccessLevel(
            '\\Global\\Active',
            'Active User',
            'A active user. Can login and change the user password.',
            '\\Zepi\\Core\\AccessControl'
        ));
    }
539508
func (s *JobExecutionState) SetVersionNumber(v int64) *JobExecutionState {
	s.VersionNumber = &v
	return s
}
126685
protected function registerSupportedVersions(VersionControl $version): void
    {
        foreach ($this->versions as $code => $namespace) {
            $version->addVersion($code, $namespace);
        }

        if (! is_null($this->defaultVersion)) {
            $version->setDefaultVersion($this->defaultVersion);
        }
    }
556622
public function version($versionId, $reset = false)
    {
        $versions = $this->versions($reset);
        if (empty($versions[$versionId])) {
            return null;
        }

        return $versions[$versionId];
    }
1033432
public function execute($versionData = null)
    {
        $batch = $this->getBatch();

        switch (count((array) $versionData)) {
            case 0:
                // Can be enabled in 1.7.3, for now leave it for testing
                // $batch->addToCounter('import_errors');
                // $batch->addMessage($this->_('No "version" data found in import file.'));
                // break;

            case 1;
                break;

            default:
                $batch->addToCounter('import_errors');
                $batch->addMessage(sprintf(
                        $this->_('%d sets of "version" data found in import file.'),
                        count($versionData)
                        ));
                foreach ($tracksData as $lineNr => $versionData) {
                    $batch->addMessage(sprintf(
                            $this->_('"version" data found on line %d.'),
                            $lineNr
                            ));
                }
        }
    }
823023
public function getOneVersion($versionNumber, $con = null)
    {
        return ChildDealerBrandVersionQuery::create()
            ->filterByDealerBrand($this)
            ->filterByVersion($versionNumber)
            ->findOne($con);
    }
134194
static public function updateNontranslatableAttributes( $objectID, $versionNum )
    {
        $object = eZContentObject::fetch( $objectID );
        $version = $object->version( $versionNum );

        $nonTranslatableAttributes = $version->nonTranslatableAttributesToUpdate();
        if ( $nonTranslatableAttributes )
        {
            $attributes = $version->contentObjectAttributes( $version->initialLanguageCode() );
            $attributeByClassAttrID = array();
            foreach ( $attributes as $attribute )
            {
                $attributeByClassAttrID[$attribute->attribute( 'contentclassattribute_id' )] = $attribute;
            }

            foreach ( $nonTranslatableAttributes as $attributeToUpdate )
            {
                $originalAttribute =& $attributeByClassAttrID[$attributeToUpdate->attribute( 'contentclassattribute_id' )];
                if ( $originalAttribute )
                {
                    unset( $tmp );
                    $tmp = $attributeToUpdate;
                    $tmp->initialize( $attributeToUpdate->attribute( 'version' ), $originalAttribute );
                    $tmp->setAttribute( 'id', $attributeToUpdate->attribute( 'id' ) );
                    $tmp->setAttribute( 'language_code', $attributeToUpdate->attribute( 'language_code' ) );
                    $tmp->setAttribute( 'language_id', $attributeToUpdate->attribute( 'language_id' ) );
                    $tmp->setAttribute( 'attribute_original_id', $originalAttribute->attribute( 'id' ) );
                    $tmp->store();
                    $tmp->postInitialize( $attributeToUpdate->attribute( 'version' ), $originalAttribute );
                }
            }
        }
    }
155001
public function deleteVersion($contentId, $versionNo)
    {
        $versionInfo = $this->loadVersionInfo($contentId, $versionNo);

        $this->locationGateway->deleteNodeAssignment($contentId, $versionNo);

        $this->fieldHandler->deleteFields($contentId, $versionInfo);

        $this->contentGateway->deleteRelations($contentId, $versionNo);
        $this->contentGateway->deleteVersions($contentId, $versionNo);
        $this->contentGateway->deleteNames($contentId, $versionNo);
    }
1141454
public function createNewVersionNode(NodeInterface $originalNode, $versionName = '')
    {
        $status = $this->statusRepository->findOneByInitial();

        /** @var NodeInterface $newNode */
        $newNode = clone $originalNode;
        $newNode->setStatus($status);
        $newNode->setVersion($this->uniqueIdGenerator->generateUniqueId());
        $this->duplicateArea($originalNode, $newNode);

        $newNode->setVersionName($versionName);
        if (empty($versionName)) {
            $newNode = $this->setVersionName($newNode);
        }


        return $newNode;
    }
379587
public function activate($versionNumber, $oldVersionNumber = '')
    {
        // Add the assets
        $assetManager = $this->framework->getInstance('\\Zepi\\Web\\General\\Manager\\AssetManager');
        $assetManager->addAsset(AssetManager::CSS, 'bootstrap', 'vendor/twitter/bootstrap/dist/css/bootstrap.css');
        $assetManager->addAsset(AssetManager::CSS, 'bootstrap-theme', 'vendor/twitter/bootstrap/dist/css/bootstrap-theme.css', array('bootstrap'));
        $assetManager->addAsset(AssetManager::CSS, 'materialdesignicons', 'vendor/mervick/material-design-icons/css/material-icons.css');
        $assetManager->addAsset(AssetManager::CSS, 'zt-base', $this->directory . '/assets/css/base.css', array('bootstrap-theme'));
        $assetManager->addAsset(AssetManager::CSS, 'zt-theme', $this->directory . '/assets/css/theme.css', array('zt-base'));
        $assetManager->addAsset(AssetManager::CSS, 'zt-elements', $this->directory . '/assets/css/elements.css', array('zt-base'));
        $assetManager->addAsset(AssetManager::CSS, 'zt-form', $this->directory . '/assets/css/form.css', array('zt-base'));
        $assetManager->addAsset(AssetManager::CSS, 'zt-print', $this->directory . '/assets/css/print.css', array('zt-base'));
        
        $assetManager->addAsset(AssetManager::JS, 'modernizr', 'vendor/components/modernizr/modernizr.js');
        $assetManager->addAsset(AssetManager::JS, 'jquery', 'vendor/components/jquery/jquery.min.js');
        $assetManager->addAsset(AssetManager::JS, 'bootstrap', 'vendor/twitter/bootstrap/dist/js/bootstrap.min.js', array('jquery'));
        $assetManager->addAsset(AssetManager::JS, 'zt-main', $this->directory . '/assets/js/main.js', array('jquery'));
        
        $assetManager->addAsset(AssetManager::IMAGE, 'logo', $this->directory . '/assets/images/logo.svg');
        $assetManager->addAsset(AssetManager::IMAGE, 'logo-mail', $this->directory . '/assets/images/logo-mail.jpg');
        
        // Add the templates
        $templatesManager = $this->framework->getInstance('\\Zepi\\Web\\General\\Manager\\TemplatesManager');
        $templatesManager->addTemplate('\\Zepi\\Web\\ThemeZt\\Templates\\Header', $this->directory . '/templates/overall/Header.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\ThemeZt\\Templates\\Footer', $this->directory . '/templates/overall/Footer.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\ThemeZt\\Templates\\NavItemRoot', $this->directory . '/templates/snippets/NavItemRoot.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\ThemeZt\\Templates\\NavItemSubmenu', $this->directory . '/templates/snippets/NavItemSubmenu.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\ThemeZt\\Templates\\Mail\\Header', $this->directory . '/templates/mail/Header.phtml');
        $templatesManager->addTemplate('\\Zepi\\Web\\ThemeZt\\Templates\\Mail\\Footer', $this->directory . '/templates/mail/Footer.phtml');
        
        // Add the settings
        $configurationManager = $this->framework->getInstance('\\Zepi\\Core\\Utils\\Manager\\ConfigurationManager');
        $configurationManager->addSettingIfNotSet('web.defaultPage', '/');
        $configurationManager->saveConfigurationFile();
    }
897121
public function applyVersionOperations()
    {
        foreach ($this->checkoutUuids as $uuid) {
            $node = $this->defaultSession->getNodeByIdentifier($uuid);
            $path = $node->getPath();

            if (!$this->versionManager->isCheckedOut($path)) {
                $this->versionManager->checkout($path);
            }
        }

        $this->checkoutUuids = [];

        /** @var NodeInterface[] $nodes */
        $nodes = [];
        $nodeVersions = [];
        foreach ($this->checkpointUuids as $versionInformation) {
            $node = $this->defaultSession->getNodeByIdentifier($versionInformation['uuid']);
            $path = $node->getPath();

            $version = $this->versionManager->checkpoint($path);

            if (!array_key_exists($path, $nodes)) {
                $nodes[$path] = $this->defaultSession->getNode($path);
            }
            $versions = $nodes[$path]->getPropertyValueWithDefault(static::VERSION_PROPERTY, []);

            if (!array_key_exists($path, $nodeVersions)) {
                $nodeVersions[$path] = $versions;
            }
            $nodeVersions[$path][] = json_encode(
                [
                    'locale' => $versionInformation['locale'],
                    'version' => $version->getName(),
                    'author' => $versionInformation['author'],
                    'authored' => date('c'),
                ]
            );
        }

        foreach ($nodes as $uuid => $node) {
            $node->setProperty(static::VERSION_PROPERTY, $nodeVersions[$uuid]);
        }

        $this->defaultSession->save();
        $this->checkpointUuids = [];
    }
711823
protected function updateFieldData(VersionInfo $versionInfo, Field $field)
    {
        $updateQuery = $this->connection->createQueryBuilder();
        $updateQuery->update($this->connection->quoteIdentifier(self::MAP_LOCATION_TABLE))
            ->set($this->connection->quoteIdentifier('latitude'), ':latitude')
            ->set($this->connection->quoteIdentifier('longitude'), ':longitude')
            ->set($this->connection->quoteIdentifier('address'), ':address')
            ->where(
                $updateQuery->expr()->andX(
                    $updateQuery->expr()->eq(
                        $this->connection->quoteIdentifier('contentobject_attribute_id'),
                        ':fieldId'
                    ),
                    $updateQuery->expr()->eq(
                        $this->connection->quoteIdentifier('contentobject_version'),
                        ':versionNo'
                    )
                )
            )
            ->setParameter(':latitude', $field->value->externalData['latitude'])
            ->setParameter(':longitude', $field->value->externalData['longitude'])
            ->setParameter(':address', $field->value->externalData['address'])
            ->setParameter(':fieldId', $field->id, PDO::PARAM_INT)
            ->setParameter(':versionNo', $versionInfo->versionNo, PDO::PARAM_INT)
        ;

        $updateQuery->execute();
    }
697656
public function process(Version $version)
    {
        $image = $version->getImagineImage();
        $transformation = new Transformation($this->app->make(ImagineInterface::class));
        $transformation->applyFilter($image, new Autorotate());
        $format = BitmapFormat::FORMAT_JPEG;
        $saveOptions = $this->app->make(BitmapFormat::class)->getFormatImagineSaveOptions($format);
        $version->updateContents($image->get($format, $saveOptions), $this->rescanThumbnails);
    }
2050
public function updateLocationsContentVersionNo($contentId, $versionNo)
    {
        $query = $this->handler->createUpdateQuery();
        $query->update(
            $this->handler->quoteTable('ezcontentobject_tree')
        )->set(
            $this->handler->quoteColumn('contentobject_version'),
            $query->bindValue($versionNo, null, \PDO::PARAM_INT)
        )->where(
            $query->expr->eq(
                $this->handler->quoteColumn('contentobject_id'),
                $contentId
            )
        );
        $query->prepare()->execute();
    }
487026
public function insertVersion(VersionInfo $versionInfo, array $fields)
    {
        try {
            return $this->innerGateway->insertVersion($versionInfo, $fields);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
1339321
public Versioned<V> update(V newValue, long newVersion) {
    Versioned<V> previousValue = value;
    value = new Versioned<>(newValue, newVersion);
    return previousValue;
  }
97026
public static function getVersionForNumber(int $versionNumber) : self
    {
        if ($versionNumber < 1 || $versionNumber > 40) {
            throw new InvalidArgumentException('Version number must be between 1 and 40');
        }

        return self::versions()[$versionNumber - 1];
    }