Get CSV rows/cols for use in template
@return ArrayList
512842
public function getRows()
    {
        $out = new ArrayList();
        foreach ($this->rows as $row) {
            $columns = new ArrayList();
            foreach ($row as $column => $value) {
                $columns->push(
                    new ArrayData(array(
                        "Heading"=> $column,
                        "Value" => $value
                    ))
                );
            }
            $out->push(
                new ArrayData(array(
                    "Columns" => $columns
                ))
            );
        }
        return $out;
    }
714954
public function toArray(): array
    {
        $return = [];
        foreach ($this as $row) {
            if (is_array($row)) {
                $return[] = $row;
            } elseif (method_exists($row, 'toArray')) {
                $return[] = $row->toArray();
            } elseif (method_exists($row, 'getArrayCopy')) {
                $return[] = $row->getArrayCopy();
            } else {
                throw new Exception\RuntimeException(
                    __METHOD__ . ': Rows as part of this DataSource, with type ' . gettype($row) . ' cannot be cast to an array'
                );
            }
        }

        return $return;
    }
993684
public static function get_delimiter_list() {
        global $CFG;
        $delimiters = array('comma'=>',', 'semicolon'=>';', 'colon'=>':', 'tab'=>'\\t');
        if (isset($CFG->CSV_DELIMITER) and strlen($CFG->CSV_DELIMITER) === 1 and !in_array($CFG->CSV_DELIMITER, $delimiters)) {
            $delimiters['cfg'] = $CFG->CSV_DELIMITER;
        }
        return $delimiters;
    }
1000266
protected function getColumns(): array
    {
        $link = config('cortex.foundation.route.locale_prefix')
            ? '"<a href=\""+routes.route(\'managerarea.roles.edit\', {role: full.id, locale: \''.$this->request->segment(1).'\'})+"\">"+data+"</a>"'
            : '"<a href=\""+routes.route(\'managerarea.roles.edit\', {role: full.id})+"\">"+data+"</a>"';

        return [
            'title' => ['title' => trans('cortex/auth::common.title'), 'render' => $link, 'responsivePriority' => 0],
            'name' => ['title' => trans('cortex/auth::common.name')],
            'created_at' => ['title' => trans('cortex/auth::common.created_at'), 'render' => "moment(data).format('YYYY-MM-DD, hh:mm:ss A')"],
            'updated_at' => ['title' => trans('cortex/auth::common.updated_at'), 'render' => "moment(data).format('YYYY-MM-DD, hh:mm:ss A')"],
        ];
    }
1122810
public function toStrictArray() {
        $colsArray = $this->getColArray();
        
        $rowsArray = $this->rows;
        
        array_walk($rowsArray, function (&$item, $key, $cols) {
            $item = array('c' => $item->toMatchingArray($cols));
        }, $this->cols);

        return self::getFilteredArray($colsArray, $rowsArray, $this->p);
        
    }
1176122
public String generateCsv() throws ClassNotFoundException {

        CmsHtmlList list = A_CmsListDialog.getListObject(Class.forName(getParamListclass()), getSettings());
        return list.listCsv();
    }
646815
public function get_columns() {
        if (isset($this->_columns)) {
            return $this->_columns;
        }

        global $USER, $CFG;

        $filename = $CFG->tempdir.'/csvimport/'.$this->_type.'/'.$USER->id.'/'.$this->_iid;
        if (!file_exists($filename)) {
            return false;
        }
        $fp = fopen($filename, "r");
        $line = fgetcsv($fp);
        fclose($fp);
        if ($line === false) {
            return false;
        }
        $this->_columns = $line;
        return $this->_columns;
    }
121401
public function getCMSFields()
    {
        $fields = $this->scaffoldFormFields(
            array(
                // Don't allow has_many/many_many relationship editing before the record is first saved
                'includeRelations' => ($this->ID > 0),
                'tabbed' => true,
                'ajaxSafe' => true
            )
        );
        $fields->removeByName('HasMain');
        $fields->addFieldsToTab(
            'Root.Main',
            array(
                TextField::create(
                    'Title',
                    _t('PlaceablePageType.TITLE', 'Title')
                )->setMaxLength(17),
                TextField::create(
                    'Description',
                    _t('PlaceablePageType.DESCRIPTION', 'Description')
                ),
                UploadField::create(
                    'Icon',
                    _t('PlaceablePageType.ICON', 'Icon')
                )
            )
        );

        $fields->addFieldToTab(
            'Root.Pages',
            GridField::create(
                'Pages',
                _t('PlaceablePageType.PAGES', 'Pages'),
                $this->Pages()
            )
        );

        $fields->addFieldToTab(
            'Root.Regions',
            GridField::create(
                'Regions',
                _t('PlaceablePageType.SECTIONS', 'Regions'),
                $this->Regions(),
                GridFieldConfig_MultiClass::create(
                    $this->Regions(),
                    singleton('RegionObject_Preset')->SubClassNames
                )
            )
        );
        return $fields;
    }
883340
public function toArray()
    {
        $arrayResult = array(
            'affected' => $this->getAffected(),
            'insertId' => $this->getInsertId(),
            'startRow' => $this->getStartRow(),
            'totalRows' => $this->getTotalRows(),
            'totalShows' => $this->getTotalShows(),
            'start' => $this->getStart(),
            'end' => $this->getEnd(),
            'seconds' => $this->getSeconds(),
            'types' => $this->getTypes(),
            'columns' => $this->getColumns(),
            'data' => array(),
        );

        if ($this->dataType instanceof DataInterface) {
            for ($i = 0; $i < $this->length(); ++$i) {
                if ($this->hasIndex($i)) {
                    $arrayResult['data'][] = $this->getIndex($i)->toArray();
                }
            }
        } else {
            $arrayResult['data'] = $this->getArrayCopy();
        }

        return $arrayResult;
    }
1182233
public function getRows()
    {
        $rows = [];

        foreach ($this->getModules() as $module) {
            $rows[] = [
                $module->getName(),
                $module->enabled() ? 'Enabled' : 'Disabled',
                $module->get('order'),
                $module->getPath(),
            ];
        }

        return $rows;
    }
1363230
public function toCsv()
    {
        $csv = '';

        foreach ($this->toArray() as $csvRow) {
            if (is_array($csvRow)) {
                $data = implode($this->_csvDelimiter, $csvRow);
            } else {
                $data = $csvRow;
            }

            $csv .= $data . $this->_csvLineDelimiter;
        }

        return rtrim($csv, $this->_csvLineDelimiter);
    }
1286530
function GetArray()
    {
		$fms = $this->_phreezer->GetFieldMaps(get_class($this));
		$cols = Array();

        foreach ($fms as $fm)
        {
			$prop = $fm->PropertyName;
			$cols[$fm->ColumnName] = $this->$prop;
        }

        return $cols;
	}
1313147
public function getRowCount()
	{
		$iterator	= new FS_File_CSV_Iterator( $this->fileName, $this->delimiter );
		$counter	= 0;
		while( $iterator->next() )
			$counter++;
		if( $counter && $this->withHeaders )
			$counter--;
		return $counter;
	}
1041141
protected function collectRows()
    {
        $rows = collect($this->collection->all())
            ->filter(function ($template) {
                return $template['is_alias'] == false;
            })
            ->sortBy('name')
            ->map(function ($template) {
                $row = [];

                $names = array_merge([$template['name']], $template['aliases']);
                $row[] = implode("\n/ ", $names);
                $row[] = wordwrap($template['path'], 65, "\n", true);
                $row[] = wordwrap($template['description'], 25, "\n", true);

                return $row;
            });

        return $this->separateRows($rows);
    }
520710
public function getDataRows()
    {
        $list = array();
        foreach ($this->components as $child) {
            if ($child instanceof DataRow) {
                $list[] = $child;
            }
        }
        return $list;
    }
313964
public function loadColumns(): ColumnlistInterface
    {
        $this->db->sql('SHOW FIELDS FROM `' . $this->table . '`');

        $result = $this->db->all();

        $columnlist = new Columnlist();

        foreach ($result as $row) {

            $name = $row['Field'];
            $null = $row['Null'] != 'YES' ? false : true;
            $default = isset($row['Default']) ? $row['Default'] : null;
            $unsigned = false;

            // Is column auto increment?
            $auto = strpos($row['Extra'], 'auto_increment') !== false ? true : false;

            $matches = [];

            // Size of field?
            if (preg_match('~(.+?)\s*\((\d+)\)(?:(?:\s*)?(unsigned))?~i', $row['Type'], $matches) === 1) {

                $type = $matches[1];
                $size = $matches[2];

                if (!empty($matches[3]) && $matches[3] == 'unsigned') {
                    $unsigned = true;
                }
            }
            else {
                $type = $row['Type'];
                $size = null;
            }



            $column = new Column();
            $column->setName($name);
            $column->setType($type);
            $column->setSize($size);
            $column->setDefault($default);



            $this->addColumn($name, $null, $default, $type, $size, $auto, $unsigned);
        }

        return $columnlist;

    }
681617
public function GetTemplateFiles()
	{
		$files = array();
		
		list($nothing,$data) = explode("[files]", $this->GetConfigFileContents(),2);
		
		if ($data)
		{
			$lines = explode("\n",$data);
			
			foreach ($lines as $line)
			{
				if ($line) $files[] = new TemplateFile($line);
			}
		}
		
		return $files;
	}