Creates or updates (if $this->overrideExisting set to TRUE) tbe section and populates it

@return \BackBee\Console\Command\UpgradeToPageSectionCommand
193669
private function updateSectionTable()
    {
        $this->em->getConnection()->executeUpdate('SET FOREIGN_KEY_CHECKS=0');

        $schemaTool = new SchemaTool($this->em);
        $schemaManager = $this->em->getConnection()->getSchemaManager();
        $sectionMeta = $this->em->getClassMetadata('BackBee\NestedNode\Section');
        $tableSection = $sectionMeta->getTableName();

        if (false === $schemaManager->tablesExist([$tableSection])) {
            $this->output->writeln(sprintf('<info>Creating table `%s`</info>', $tableSection));
            $schemaTool->createSchema(array($sectionMeta));
        } else {
            if (false === $this->overrideExisting) {
                return $this;
            }

            $this->output->writeln(sprintf('<info>Updating table `%s`</info>',$tableSection));
            $schemaTool->updateSchema(array($sectionMeta), true);
            $this->em->getConnection()->executeUpdate(sprintf('DELETE FROM %s WHERE 1=1', $tableSection));
        }

        $query = sprintf(
                'INSERT INTO %s (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s) ',
                $tableSection,
                $this->requiredFields['uid'],
                $this->requiredFields['root_uid'],
                $this->requiredFields['parent_uid'],
                $this->requiredFields['leftnode'],
                $this->requiredFields['rightnode'],
                $this->requiredFields['level'],
                $this->requiredFields['created'],
                $this->requiredFields['modified'],
                $sectionMeta->getSingleAssociationJoinColumnName('_page'),
                $this->requiredFields['site_uid']
        );
        
        $pageMeta = $this->em->getClassMetadata('BackBee\NestedNode\Page');
        $tablePage = $pageMeta->getTableName();

        $query .= sprintf('SELECT %s, %s, %s, %s, %s, %s, %s, %s, %s, %s FROM %s WHERE %s > %s + 1',
                $this->requiredFields['uid'],
                $this->requiredFields['root_uid'],
                $this->requiredFields['parent_uid'],
                $this->requiredFields['leftnode'],
                $this->requiredFields['rightnode'],
                $this->requiredFields['level'],
                $this->requiredFields['created'],
                $this->requiredFields['modified'],
                $this->requiredFields['uid'],
                $this->requiredFields['site_uid'],
                $tablePage,
                $this->requiredFields['rightnode'],
                $this->requiredFields['leftnode']
        );

        $result = $this->em->getConnection()->executeQuery($query);
        $this->em->getConnection()->executeUpdate('SET FOREIGN_KEY_CHECKS=1');

        $this->output->writeln(sprintf(' - %d section rows created', $result->rowCount()));

        return $this;
    }
428087
public function postUpdateComponentOrder()
    {
        $componentData = Binput::get('ids');

        foreach ($componentData as $order => $componentId) {
            try {
                $component = Component::find($componentId);

                execute(new UpdateComponentCommand(
                    $component,
                    $component->name,
                    $component->description,
                    $component->status,
                    $component->link,
                    $order + 1,
                    $component->group_id,
                    $component->enabled,
                    $component->meta,
                    true
                ));
            } catch (QueryException $e) {
                throw new BadRequestHttpException();
            }
        }

        return $this->collection(Component::query()->orderBy('order')->get());
    }
794704
public function update() {
    $this->db()->update($this->table, $this->record, $this->identifier());
    $this->isDirty = FALSE;

    return $this;
  }
435246
public function set_upgrade_in_progress() {
		$retval = false;
		$showDbVersion = $this->databaseVersion;
		if(is_null($showDbVersion) || !strlen($showDbVersion)) {
			$showDbVersion = "(unknown)";
		}
		if(!$this->lockObj->is_lockfile_present()) {
			$details = $this->projectName .': Upgrade from '. $showDbVersion .' started at '. date('Y-m-d H:i:s');
			$this->lockObj->create_lockfile($details);
		}
		$retval = $this->lockObj->is_lockfile_present();
		
		return $retval;
	}
854484
public function upgradeBook() {

		$book_structure = Book::getBookStructure();
		foreach ( $book_structure['__order'] as $post_id => $_ ) {

			$meta = get_post_meta( $post_id );
			$compare = $this->getDeprecatedComparisonTable( get_post_type( $post_id ) );

			foreach ( $meta as $meta_key => $meta_value ) {
				$new_meta_key = ( isset( $compare[ $meta_key ] ) ) ? $compare[ $meta_key ] : false;
				if ( $new_meta_key ) {
					$meta_id = $this->getMidByKey( $post_id, $meta_key );
					if ( $meta_id ) {
						if ( isset( $this->upgradeCheckboxes[ $meta_key ] ) ) {
							$meta_value = 'on';
						} elseif ( is_array( $meta_value ) ) {
							$meta_value = array_values( $meta_value );
							$meta_value = array_pop( $meta_value );
						}
						// Update the original $meta_key to the $new_meta_key
						update_metadata_by_mid( 'post', $meta_id, $meta_value, $new_meta_key );
					}
				}
			}
		}

	}
677414
public function getUpdateTemplate()
    {
        if (null === $this->updateTemplate) {
            $template = rtrim($this->getTemplatePrefix(), '/') . '/' . $this->getUpdateSuffix();
            $this->setUpdateTemplate($template);
        }

        return $this->updateTemplate;
    }
241709
private function createCommand()
    {
        $cmd = ['create' => $this->collectionName];

        foreach (['autoIndexId', 'capped', 'flags', 'max', 'maxTimeMS', 'size', 'validationAction', 'validationLevel'] as $option) {
            if (isset($this->options[$option])) {
                $cmd[$option] = $this->options[$option];
            }
        }

        foreach (['collation', 'indexOptionDefaults', 'storageEngine', 'validator'] as $option) {
            if (isset($this->options[$option])) {
                $cmd[$option] = (object) $this->options[$option];
            }
        }

        return new Command($cmd);
    }
118539
public function postUpdateComponentGroupOrder()
    {
        $groupData = Binput::get('ids');

        foreach ($groupData as $order => $groupId) {
            $group = ComponentGroup::find($groupId);

            execute(new UpdateComponentGroupCommand(
                $group,
                $group->name,
                $order + 1,
                $group->collapsed,
                $group->visible
            ));
        }

        return $this->collection(ComponentGroup::query()->orderBy('order')->get());
    }
705267
public function cmdUpdateCollection()
    {
        $params = $this->getParam();

        if (empty($params[0]) || count($params) < 2) {
            $this->errorAndExit($this->text('Invalid command'));
        }

        if (!is_numeric($params[0])) {
            $this->errorAndExit($this->text('Invalid argument'));
        }

        $this->setSubmitted(null, $params);
        $this->setSubmitted('update', $params[0]);
        $this->validateComponent('collection');

        $this->updateCollection($params[0]);
        $this->output();
    }
54898
public function update()
    {
        $this->setUpVersion();
        $connection = $this->getConnection();
        foreach ($this->folders as $name => $path) {
            $folder = new FolderImpl($path);
            if (!$folder->exists()) {
                continue;
            }
            /** @var File[] $files */
            $files = $folder->listFolder(Folder::LIST_FOLDER_FILES);

            usort($files, function (File $a, File $b) {
                return $this->leadingNumber($a->getFilename()) - $this->leadingNumber($b->getFilename());
            });
            $lastFile = null;
            $version = $this->getVersion($name);
            foreach ($files as $file) {
                if ($file->getExtension() != 'sql') {
                    continue;
                }

                if ($this->leadingNumber($file->getFilename()) <= $version) {
                    continue;
                }

                $stmt = $connection->prepare($file->getContents());
                $stmt->execute();

                while ($stmt->nextRowset()) ; //Polling row sets

                $lastFile = $file;
            }
            if ($lastFile == null) {
                continue;
            }
            $this->setVersion($name, $this->leadingNumber($lastFile->getFilename()));

        }
    }
321274
protected function _update()
    {
        $this->setUpdateSeo(true);
        $this->_setUpdateSeoOnFieldChange('oxtitle');

        $this->_skipSaveFields();

        return parent::_update();
    }
577623
public function Upgrade155to156()
    {
        $this->_batch->addTask('Db_AddPatches', 49);

        $this->_batch->addTask('Echo', $this->_('Make sure to read the changelog as it contains important instructions'));

        return true;
    }
1157973
public function UpdateItem()
    {
        $pathExpr = $this->SingleValuedPathExpression();

        $this->match(Lexer::T_EQUALS);

        $updateItem = new AST\UpdateItem($pathExpr, $this->NewValue());

        return $updateItem;
    }
487327
public function update($updateNulls = false)
    {
        // Event
        $this->triggerEvent(
            'onBefore' . ucfirst(__FUNCTION__),
            [
                'updateNulls' => &$updateNulls,
            ]
        );

        $this->triggerEvent(
            'onBeforeStore',
            [
                'updateNulls' => &$updateNulls,
            ]
        );

        // Do Action
        $this->getDataMapper()->updateOne($this, $this->getKeyName(true), $updateNulls);

        // Event
        $this->triggerEvent(
            'onAfterStore',
            [
                'updateNulls' => &$updateNulls,
            ]
        );

        $this->triggerEvent('onAfter' . ucfirst(__FUNCTION__));

        return $this;
    }
51250
public function refresh() : self {
      $newCode = $this->collection->assemble();
      $tokens = Helper::getTokensFromString($newCode);

      $this->collection->setItems($tokens);
      return $this;
    }
656950
public function update()
    {
        if ($this->newVersionAvailable === false
        || (!is_bool($this->newVersionAvailable) && !$this->hasUpdate())) {
            return false;
        }
        $this->backupPhar();
        $this->downloadPhar();
        $this->replacePhar();
        return true;
    }
1085037
protected ActionCommand createUpdateCommand()
    {
        ActionCommand command = new ActionCommand(UPDATE_COMMAND_ID)
        {

            @Override
            protected void doExecuteCommand()
            {
                doUpdate();
            }
        };
        command.setSecurityControllerId(getId() + "." + UPDATE_COMMAND_ID);
        getApplicationConfig().commandConfigurer().configure(command);
        getDetailForm().addGuarded(command, FormGuard.LIKE_COMMITCOMMAND);
        return command;
    }