public function getRawData($columnNames = null, $namedIndexes = true)
    {
        if ($columnNames === null) {
            foreach ($this->getColumns() as $column) {
                $columnNames[] = $column->getId();
            }
        }

        $columnNames = (array) $columnNames;
        $result = [];
        foreach ($this->rows as $row) {
            $resultRow = [];
            foreach ($columnNames as $columnName) {
                if ($namedIndexes) {
                    $resultRow[$columnName] = $row->getField($columnName);
                } else {
                    $resultRow[] = $row->getField($columnName);
                }
            }

            $result[] = $resultRow;
        }

        return $result;
    }
public function getRawData($columnNames = null, $namedIndexes = true)
    {
        if ($columnNames === null) {
            foreach ($this->getColumns() as $column) {
                $columnNames[] = $column->getId();
            }
        }

        $columnNames = (array) $columnNames;
        $result = [];
        foreach ($this->rows as $row) {
            $resultRow = [];
            foreach ($columnNames as $columnName) {
                if ($namedIndexes) {
                    $resultRow[$columnName] = $row->getField($columnName);
                } else {
                    $resultRow[] = $row->getField($columnName);
                }
            }

            $result[] = $resultRow;
        }

        return $result;
    }
public function getRawData ( $ columnNames = null , $ namedIndexes = true ) { if ( $ columnNames === null ) { foreach ( $ this -> getColumns ( ) as $ column ) { $ columnNames [ ] = $ column -> getId ( ) ; } } $ columnNames = ( array ) $ columnNames ; $ result = [ ] ; foreach ( $ this -> rows as $ row ) { $ resultRow = [ ] ; foreach ( $ columnNames as $ columnName ) { if ( $ namedIndexes ) { $ resultRow [ $ columnName ] = $ row -> getField ( $ columnName ) ; } else { $ resultRow [ ] = $ row -> getField ( $ columnName ) ; } } $ result [ ] = $ resultRow ; } return $ result ; }
Extract raw data of columns.

@param string|array $columnNames  The name of the extract columns. If null, all the columns are return.
@param bool         $namedIndexes If sets to true, named indexes will be used

@return array Raw data of columns
Extract raw data of columns .