Finalize groups that implement the Groupable trait.

@return void
335040
public function finalize()
    {
        $gen = new UrlGenerator();
        if (!empty($this->redirect)) {
            $gen->redirect($this->redirect);
        }
    }
738756
private function SaveGroups()
    {
        $assignedIDs = $this->AssignedGroupIDs();
        $selectedIDs = Request::PostArray('Group');
        $this->ClearMembergroups($selectedIDs);
        foreach ($selectedIDs as $selectedID)
        {
            if (!in_array($selectedID, $assignedIDs))
            {
                $confirmGroup = new RegisterConfirmMembergroup();
                $confirmGroup->SetConfirm($this->confirm);
                $confirmGroup->SetMemberGroup(Membergroup::Schema()->ByID($selectedID));
                $confirmGroup->Save();
            }
        }
    }
397626
public function destroy() {
        // Before reseting anything, call destroy recursively
        foreach ($this->children as $child) {
            $child->destroy();
        }
        foreach ($this->final_elements as $element) {
            $element->destroy();
        }
        if ($this->optigroup) {
            $this->optigroup->destroy();
        }
        // Everything has been destroyed recursively, now we can reset safely
        $this->children = array();
        $this->final_elements = array();
        $this->optigroup = null;
        // Delegate to parent to destroy other bits
        parent::destroy();
    }
1088410
public function clearDoublettes() {
		/** @var array $x */
		$x = $this->_connection->query('SELECT max(id) as id FROM `' . $this->getTable() . '`
	WHERE completed is NULL
	GROUP BY data
	HAVING COUNT(id) > 1');

		$start = 0;
		$x = array_keys($x);
		$numX = count($x);
		while ($start <= $numX) {
			$this->deleteAll([
				'id' => array_slice($x, $start, 10),
			]);
			$start = $start + 100;
		}
	}
722557
public function finalize()
    {
        /** @var Process $process */
        $process = $this->process;

        if ($process) {
            $process->wait();

            if ($process->isSuccessful()) {
                $this->successful = true;
                $this->output =  $process->getOutput();
            } else {
                $this->successful = false;
                $this->output =  $process->getErrorOutput();
            }

            $this->postRun();

            unset($this->process);
        }
    }
98103
protected function onInit()
    {
        $this->groupColumns = $this->parseGroups(Utility::get($this->params, "by"));
        $this->sumColumns = $this->parseGroups(Utility::get($this->params, "sum"));
        $this->countColumns = $this->parseGroups(Utility::get($this->params, "count"));
        $this->avgColumns = $this->parseGroups(Utility::get($this->params, "avg"));
        $this->minColumns = $this->parseGroups(Utility::get($this->params, "min"));
        $this->maxColumns = $this->parseGroups(Utility::get($this->params, "max"));

        $this->sort = Utility::get($this->params, "sort", true);
        $this->gData = array();
        $this->cData = array();
    }
995673
public void completeGroup() {
		// Copy initial set to allow permutations to grow
		List<List<Integer>> gens = new ArrayList<List<Integer>>(permutations);
		// Keep HashSet version of permutations for fast lookup.
		Set<List<Integer>> known = new HashSet<List<Integer>>(permutations);
		//breadth-first search through the map of all members
		List<List<Integer>> currentLevel = new ArrayList<List<Integer>>(permutations);
		while( currentLevel.size() > 0) {
			List<List<Integer>> nextLevel = new ArrayList<List<Integer>>();
			for( List<Integer> p : currentLevel) {
				for(List<Integer> gen : gens) {
					List<Integer> y = combine(p,gen);
					if(!known.contains(y)) {
						nextLevel.add(y);
						//bypass addPermutation(y) for performance
						permutations.add(y);
						known.add(y);
					}
				}
			}
			currentLevel = nextLevel;
		}
	}
137571
public function finalize() : Route
    {
        if ($this->finalized) {
            return $this;
        }

        foreach ($this->getGroups() as $group) {
            foreach ($group->getMiddleware() as $middleware) {
                $this->addMiddleware($middleware);
            }
        }

        $this->finalized = true;

        return $this;
    }
386954
protected function init(): void
    {
        $this->getGroupTags = static function (Type\Group $group) { return ['type-group-' . $group->id]; };
        $this->getGroupKeys = static function (Type\Group $group) {
            return [
                'ez-content-type-group-' . $group->id,
                'ez-content-type-group-' . $group->identifier . '-by-identifier',
            ];
        };

        $this->getTypeTags = static function (Type $type) { return ['type-' . $type->id]; };
        $this->getTypeKeys = static function (Type $type, int $status = Type::STATUS_DEFINED) {
            return [
                'ez-content-type-' . $type->id . '-' . $status,
                'ez-content-type-' . $type->identifier . '-by-identifier',
                'ez-content-type-' . $type->remoteId . '-by-remote',
            ];
        };
    }
1035388
public function setGroup()
    {
        // set group position if exist

        $group = [];

        foreach ($this->data['group'] as $table => $params) {

            $params = array_flip($params);

            if (empty($params) === false) {

                foreach ($params as $field) {
                    $group[] = $table . '.' . $field;
                }
            }
        }
        $this->builder->groupBy($group);

        return null;
    }
865033
public function finalize()
    {
        if (in_array($this->status, array(204, 304))) {
            unset($this['Content-Type'], $this['Content-Length']);

            return array($this->status, $this->header, '');
        } else {
            return array($this->status, $this->header, $this->body);
        }
    }
912787
public function endGroup() {
        if ($this->groups) {
            $this->query .= ')';
            $this->dummyQuery .= ')';
            $this->groups--;
        }
        return $this;
    }
206894
public function groups(callable $groupCallback = null)
    {
        $groups = $this->groups;
        uasort($groups, [ $this, 'sortItemsByPriority' ]);

        $groupCallback = (isset($groupCallback) ? $groupCallback : $this->groupCallback);

        $groups = $this->finalizeFormGroups($groups);

        $i = 1;
        foreach ($groups as $group) {
            if ($groupCallback) {
                $groupCallback($group);
            }

            $GLOBALS['widget_template'] = $group->template();

            if (!$this->selectedFormGroup() && $this->isTabbable()) {
                $group->setIsHidden(false);
                if ($i > 1) {
                    $group->setIsHidden(true);
                }
            }
            $i++;

            yield $group;

            $GLOBALS['widget_template'] = '';
        }
    }
941796
public function groupLinksByDepth(){
        $final_items = [];
        $this->each(function(Link $linkObj, $uri) use(&$final_items){
            $final_items[$linkObj->getCrawlDepth()][$uri] = [
               'link'  => $linkObj->getAbsoluteUrl(),
               'source_page' => $linkObj->getParentUrl(),
            ];          
        });
        
        ksort($final_items);
        return $this->make($final_items);
    }
1367825
function finishGroup(&$group)
    {
        $separator = $group->_separator;
        if (is_array($separator)) {
            $count = count($separator);
            $html  = '';
            for ($i = 0; $i < count($this->_groupElements); $i++) {
                $html .= (0 == $i? '': $separator[($i - 1) % $count]) . $this->_groupElements[$i];
            }
        } else {
            if (is_null($separator)) {
                $separator = '&nbsp;';
            }
            $html = implode((string)$separator, $this->_groupElements);
        }
        if (!empty($this->_groupWrap)) {
            $html = str_replace('{content}', $html, $this->_groupWrap);
        }
        $this->_html   .= str_replace('{element}', $html, $this->_groupTemplate);
        $this->_inGroup = false;
    }
260730
public function finish(): void
    {
        foreach ($this->drivers as $name => $class) {
            $class->finish();
            unset($this->drivers[$name]);
        }

        $this->drivers = [];
    }
1070742
public function finalize()
    {
        \Ease\TWB\Part::twBootstrapize();
        $this->includeJavascript('https://cdnjs.cloudflare.com/ajax/libs/bootstrap-treeview/1.2.0/bootstrap-treeview.min.js');
        $this->includeCss('https://cdnjs.cloudflare.com/ajax/libs/bootstrap-treeview/1.2.0/bootstrap-treeview.min.css');
        $this->addJavascript('$(\'#'.$this->getTagID().'\').treeview({'.\Ease\TWB\Part::partPropertiesToString($this->properties).'})',
            null, true);
    }