protected function processExistingItems()
    {
        $loadedIndexes = $loadedGroups = [];
        $loadValue = $this->getLoadValue();

        // Ensure that the minimum number of items are preinitialized
        // ONLY DONE WHEN NOT IN GROUP MODE
        if (!$this->useGroups && $this->minItems > 0) {
            if (!is_array($loadValue)) {
                $loadValue = [];
                for ($i = 0; $i < $this->minItems; $i++) {
                    $loadValue[$i] = [];
                }
            } elseif (count($loadValue) < $this->minItems) {
                for ($i = 0; $i < ($this->minItems - count($loadValue)); $i++) {
                    $loadValue[] = [];
                }
            }
        }

        if (is_array($loadValue)) {
            foreach ($loadValue as $index => $loadedValue) {
                $loadedIndexes[] = $index;
                $loadedGroups[] = array_get($loadedValue, '_group');
            }
        }

        $itemIndexes = post($this->indexInputName, $loadedIndexes);
        $itemGroups = post($this->groupInputName, $loadedGroups);

        if (!count($itemIndexes)) {
            return;
        }

        $items = array_combine(
            (array) $itemIndexes,
            (array) ($this->useGroups ? $itemGroups : $itemIndexes)
        );

        foreach ($items as $itemIndex => $groupCode) {
            $this->makeItemFormWidget($itemIndex, $groupCode);
            $this->indexCount = max((int) $itemIndex, $this->indexCount);
        }
    }
protected function processExistingItems()
    {
        $loadedIndexes = $loadedGroups = [];
        $loadValue = $this->getLoadValue();

        // Ensure that the minimum number of items are preinitialized
        // ONLY DONE WHEN NOT IN GROUP MODE
        if (!$this->useGroups && $this->minItems > 0) {
            if (!is_array($loadValue)) {
                $loadValue = [];
                for ($i = 0; $i < $this->minItems; $i++) {
                    $loadValue[$i] = [];
                }
            } elseif (count($loadValue) < $this->minItems) {
                for ($i = 0; $i < ($this->minItems - count($loadValue)); $i++) {
                    $loadValue[] = [];
                }
            }
        }

        if (is_array($loadValue)) {
            foreach ($loadValue as $index => $loadedValue) {
                $loadedIndexes[] = $index;
                $loadedGroups[] = array_get($loadedValue, '_group');
            }
        }

        $itemIndexes = post($this->indexInputName, $loadedIndexes);
        $itemGroups = post($this->groupInputName, $loadedGroups);

        if (!count($itemIndexes)) {
            return;
        }

        $items = array_combine(
            (array) $itemIndexes,
            (array) ($this->useGroups ? $itemGroups : $itemIndexes)
        );

        foreach ($items as $itemIndex => $groupCode) {
            $this->makeItemFormWidget($itemIndex, $groupCode);
            $this->indexCount = max((int) $itemIndex, $this->indexCount);
        }
    }
protected function processExistingItems ( ) { $ loadedIndexes = $ loadedGroups = [ ] ; $ loadValue = $ this -> getLoadValue ( ) ; // Ensure that the minimum number of items are preinitialized // ONLY DONE WHEN NOT IN GROUP MODE if ( ! $ this -> useGroups && $ this -> minItems > 0 ) { if ( ! is_array ( $ loadValue ) ) { $ loadValue = [ ] ; for ( $ i = 0 ; $ i < $ this -> minItems ; $ i ++ ) { $ loadValue [ $ i ] = [ ] ; } } elseif ( count ( $ loadValue ) < $ this -> minItems ) { for ( $ i = 0 ; $ i < ( $ this -> minItems - count ( $ loadValue ) ) ; $ i ++ ) { $ loadValue [ ] = [ ] ; } } } if ( is_array ( $ loadValue ) ) { foreach ( $ loadValue as $ index => $ loadedValue ) { $ loadedIndexes [ ] = $ index ; $ loadedGroups [ ] = array_get ( $ loadedValue , '_group' ) ; } } $ itemIndexes = post ( $ this -> indexInputName , $ loadedIndexes ) ; $ itemGroups = post ( $ this -> groupInputName , $ loadedGroups ) ; if ( ! count ( $ itemIndexes ) ) { return ; } $ items = array_combine ( ( array ) $ itemIndexes , ( array ) ( $ this -> useGroups ? $ itemGroups : $ itemIndexes ) ) ; foreach ( $ items as $ itemIndex => $ groupCode ) { $ this -> makeItemFormWidget ( $ itemIndex , $ groupCode ) ; $ this -> indexCount = max ( ( int ) $ itemIndex , $ this -> indexCount ) ; } }
Processes existing form data and applies it to the form widgets.
@return void
Processes existing form data and applies it to the form widgets .