src/Controller/SortingManager.php
private function updateSorting()
    {
        $ids = $this->getModelIds();
        // If no "next" sibling, simply increment the sorting as we are at the end of the list.
        if (!$this->marker) {
            foreach ($this->results as $model) {
                $this->position += 128;
                /** @var ModelInterface $model */
                $model->setProperty($this->getSortingProperty(), $this->position);
            }

            return;
        }

        $delta = $this->determineDelta();

        // Loop over all models and increment sorting value.
        foreach ($this->results as $model) {
            $this->position += $delta;
            /** @var ModelInterface $model */
            $model->setProperty($this->getSortingProperty(), $this->position);
        }

        // When the sorting exceeds the sorting of the "next" sibling, we need to push the remaining siblings to the
        // end of the list.
        if ($this->marker->getProperty($this->getSortingProperty()) <= $this->position) {
            do {
                // Skip models about to be pasted.
                if (\in_array($this->marker->getId(), $ids)) {
                    $this->marker = $this->siblingsCopy->shift();
                    continue;
                }

                $this->position += $delta;
                $this->marker->setProperty($this->getSortingProperty(), $this->position);
                $this->results->push($this->marker);

                $this->marker = $this->siblingsCopy->shift();
            } while ($this->marker);
        }
    }
private function updateSorting()
    {
        $ids = $this->getModelIds();
        // If no "next" sibling, simply increment the sorting as we are at the end of the list.
        if (!$this->marker) {
            foreach ($this->results as $model) {
                $this->position += 128;
                /** @var ModelInterface $model */
                $model->setProperty($this->getSortingProperty(), $this->position);
            }

            return;
        }

        $delta = $this->determineDelta();

        // Loop over all models and increment sorting value.
        foreach ($this->results as $model) {
            $this->position += $delta;
            /** @var ModelInterface $model */
            $model->setProperty($this->getSortingProperty(), $this->position);
        }

        // When the sorting exceeds the sorting of the "next" sibling, we need to push the remaining siblings to the
        // end of the list.
        if ($this->marker->getProperty($this->getSortingProperty()) <= $this->position) {
            do {
                // Skip models about to be pasted.
                if (\in_array($this->marker->getId(), $ids)) {
                    $this->marker = $this->siblingsCopy->shift();
                    continue;
                }

                $this->position += $delta;
                $this->marker->setProperty($this->getSortingProperty(), $this->position);
                $this->results->push($this->marker);

                $this->marker = $this->siblingsCopy->shift();
            } while ($this->marker);
        }
    }
private function updateSorting ( ) { $ ids = $ this -> getModelIds ( ) ; // If no "next" sibling, simply increment the sorting as we are at the end of the list. if ( ! $ this -> marker ) { foreach ( $ this -> results as $ model ) { $ this -> position += 128 ; /** @var ModelInterface $model */ $ model -> setProperty ( $ this -> getSortingProperty ( ) , $ this -> position ) ; } return ; } $ delta = $ this -> determineDelta ( ) ; // Loop over all models and increment sorting value. foreach ( $ this -> results as $ model ) { $ this -> position += $ delta ; /** @var ModelInterface $model */ $ model -> setProperty ( $ this -> getSortingProperty ( ) , $ this -> position ) ; } // When the sorting exceeds the sorting of the "next" sibling, we need to push the remaining siblings to the // end of the list. if ( $ this -> marker -> getProperty ( $ this -> getSortingProperty ( ) ) <= $ this -> position ) { do { // Skip models about to be pasted. if ( \ in_array ( $ this -> marker -> getId ( ) , $ ids ) ) { $ this -> marker = $ this -> siblingsCopy -> shift ( ) ; continue ; } $ this -> position += $ delta ; $ this -> marker -> setProperty ( $ this -> getSortingProperty ( ) , $ this -> position ) ; $ this -> results -> push ( $ this -> marker ) ; $ this -> marker = $ this -> siblingsCopy -> shift ( ) ; } while ( $ this -> marker ) ; } }
Update the sorting property values of all models.

@return void
Update the sorting property values of all models .