src/OpenCart/Helpers/OcHelper.php
protected function doInstall()
    {
        $result = true;
        $this->registry->load->model('setting/setting');
        $setting = $this->registry->model_setting_setting->getSetting('acumulus_siel');
        $currentDataModelVersion = isset($setting['acumulus_siel_datamodel_version']) ? $setting['acumulus_siel_datamodel_version'] : '';

        $this->container->getLog()->info('%s: current version = %s', __METHOD__, $currentDataModelVersion);

        if ($currentDataModelVersion === '' || version_compare($currentDataModelVersion, '4.0', '<')) {
            // Check requirements (we assume this has been done successfully
            // before if the data model is at the latest version).
            $requirements = $this->container->getRequirements();
            $messages = $requirements->check();
            foreach ($messages as $message) {
                $this->addError($message['message']);
                $this->container->getLog()->error($message['message']);
            }
            if (!empty($messages)) {
                return false;
            }

            // Install tables.
            if ($result = $this->container->getAcumulusEntryManager()->install()) {
                $setting['acumulus_siel_datamodel_version'] = '4.0';
                $this->registry->model_setting_setting->editSetting('acumulus_siel', $setting);
            }
        } elseif (version_compare($currentDataModelVersion, '4.4', '<')) {
            // Update table columns.
            if ($result = $this->container->getAcumulusEntryManager()->upgrade('4.4.0')) {
                $setting['acumulus_siel_datamodel_version'] = '4.4';
                $this->registry->model_setting_setting->editSetting('acumulus_siel', $setting);
            }
        }

        // Install events
        if (empty($this->data['error_messages'])) {
            $this->installEvents();
        }

        return $result;
    }
protected function doInstall()
    {
        $result = true;
        $this->registry->load->model('setting/setting');
        $setting = $this->registry->model_setting_setting->getSetting('acumulus_siel');
        $currentDataModelVersion = isset($setting['acumulus_siel_datamodel_version']) ? $setting['acumulus_siel_datamodel_version'] : '';

        $this->container->getLog()->info('%s: current version = %s', __METHOD__, $currentDataModelVersion);

        if ($currentDataModelVersion === '' || version_compare($currentDataModelVersion, '4.0', '<')) {
            // Check requirements (we assume this has been done successfully
            // before if the data model is at the latest version).
            $requirements = $this->container->getRequirements();
            $messages = $requirements->check();
            foreach ($messages as $message) {
                $this->addError($message['message']);
                $this->container->getLog()->error($message['message']);
            }
            if (!empty($messages)) {
                return false;
            }

            // Install tables.
            if ($result = $this->container->getAcumulusEntryManager()->install()) {
                $setting['acumulus_siel_datamodel_version'] = '4.0';
                $this->registry->model_setting_setting->editSetting('acumulus_siel', $setting);
            }
        } elseif (version_compare($currentDataModelVersion, '4.4', '<')) {
            // Update table columns.
            if ($result = $this->container->getAcumulusEntryManager()->upgrade('4.4.0')) {
                $setting['acumulus_siel_datamodel_version'] = '4.4';
                $this->registry->model_setting_setting->editSetting('acumulus_siel', $setting);
            }
        }

        // Install events
        if (empty($this->data['error_messages'])) {
            $this->installEvents();
        }

        return $result;
    }
protected function doInstall ( ) { $ result = true ; $ this -> registry -> load -> model ( 'setting/setting' ) ; $ setting = $ this -> registry -> model_setting_setting -> getSetting ( 'acumulus_siel' ) ; $ currentDataModelVersion = isset ( $ setting [ 'acumulus_siel_datamodel_version' ] ) ? $ setting [ 'acumulus_siel_datamodel_version' ] : '' ; $ this -> container -> getLog ( ) -> info ( '%s: current version = %s' , __METHOD__ , $ currentDataModelVersion ) ; if ( $ currentDataModelVersion === '' || version_compare ( $ currentDataModelVersion , '4.0' , '<' ) ) { // Check requirements (we assume this has been done successfully // before if the data model is at the latest version). $ requirements = $ this -> container -> getRequirements ( ) ; $ messages = $ requirements -> check ( ) ; foreach ( $ messages as $ message ) { $ this -> addError ( $ message [ 'message' ] ) ; $ this -> container -> getLog ( ) -> error ( $ message [ 'message' ] ) ; } if ( ! empty ( $ messages ) ) { return false ; } // Install tables. if ( $ result = $ this -> container -> getAcumulusEntryManager ( ) -> install ( ) ) { $ setting [ 'acumulus_siel_datamodel_version' ] = '4.0' ; $ this -> registry -> model_setting_setting -> editSetting ( 'acumulus_siel' , $ setting ) ; } } elseif ( version_compare ( $ currentDataModelVersion , '4.4' , '<' ) ) { // Update table columns. if ( $ result = $ this -> container -> getAcumulusEntryManager ( ) -> upgrade ( '4.4.0' ) ) { $ setting [ 'acumulus_siel_datamodel_version' ] = '4.4' ; $ this -> registry -> model_setting_setting -> editSetting ( 'acumulus_siel' , $ setting ) ; } } // Install events if ( empty ( $ this -> data [ 'error_messages' ] ) ) { $ this -> installEvents ( ) ; } return $ result ; }
Checks requirements and installs tables for this module.

@return bool
Success.

@throws \Exception
Checks requirements and installs tables for this module .