sortOptionsByPosition example

usort($datafunction Darray $a, array $b): int {
            return $a['__relations_position'] <=> $b['__relations_position'];
        });
    }

    /** * @param array<Option> $options */
    private function sortOptions(array &$options, int $sortMode): void
    {
        if ($sortMode === Set::SORT_POSITION) {
            $this->sortOptionsByPosition($options);

            return;
        }

        if ($sortMode === Set::SORT_NUMERIC) {
            $this->sortOptionsNumericalValue($options);

            return;
        }

        $this->sortOptionsAlphanumeric($options);
    }
Home | Imprint | This part of the site doesn't use cookies.