kartik\export\ExportMenu::checkGroupedRow PHP Метод

checkGroupedRow() защищенный Метод

protected checkGroupedRow ( Model | array $model, Model | array $nextModel, integer $key, integer $index ) : void
$model yii\base\Model | array the data model
$nextModel yii\base\Model | array the next data model
$key integer the key associated with the data model
$index integer the zero-based index of the data model among the model array returned by [[dataProvider]].
Результат void
    protected function checkGroupedRow($model, $nextModel, $key, $index)
    {
        $endCol = 0;
        foreach ($this->getVisibleColumns() as $column) {
            /**
             * @var Column $column
             */
            $value = $column->content === null ? method_exists($column, 'getDataCellValue') ? $this->formatter->format($column->getDataCellValue($model, $key, $index), 'raw') : $column->renderDataCell($model, $key, $index) : call_user_func($column->content, $model, $key, $index, $column);
            $nextValue = $column->content === null ? method_exists($column, 'getDataCellValue') ? $this->formatter->format($column->getDataCellValue($nextModel, $key, $index), 'raw') : $column->renderDataCell($nextModel, $key, $index) : call_user_func($column->content, $nextModel, $key, $index, $column);
            if (isset($this->_groupedColumn[$endCol]) && !is_null($this->_groupedColumn[$endCol])) {
                if (is_null($this->_groupedColumn[$endCol]['value'])) {
                    $this->_groupedColumn[$endCol]['value'] = $value;
                    $this->_groupedColumn[$endCol]['firstLine'] = $index;
                }
                if ($this->_groupedColumn[$endCol]['value'] != $nextValue) {
                    $groupFooter = isset($column->groupFooter) ? $column->groupFooter : null;
                    if ($groupFooter instanceof Closure) {
                        $groupFooter = call_user_func($groupFooter, $model, $key, $index, $this);
                    }
                    if (isset($groupFooter['content'])) {
                        $this->generateGroupedRow($groupFooter['content'], $endCol);
                    }
                    $this->_groupedColumn[$endCol]['firstLine'] = $index;
                }
                $this->_groupedColumn[$endCol]['value'] = $nextValue;
            }
            $endCol++;
        }
    }