Formats the datasets for the output.

@return string
503477
public function formatDatasets()
    {
        // This little boy was commented because it's not compatible
        // in laravel < 5.4
        //
        // return Collection::make($this->datasets)
        //     ->each
        //     ->matchValues(count($this->labels))
        //     ->map
        //     ->format($this->labels)
        //     ->toJson();

        return Encoder::encode(
            Collection::make($this->datasets)
                ->each(function ($dataset) {
                    $dataset->matchValues(count($this->labels));
                })
                ->map(function ($dataset) {
                    return $dataset->format($this->labels);
                })
                ->toArray()
        );
    }
240397
private function returnOutput()
    {
        $collection = new Collection($this->results);

        switch ($this->output) {
            case 'db':
                return $this->saveToDatabase($collection);
                break;
            case 'collection':
                return $collection;
                break;
            case 'json':
                return $collection->toJson();
                break;
            case 'array':
            default:
                return $collection->toArray();
        }
    }
1325708
public function toString()
    {
        $result = '';
        foreach ($this->getChunkCursor() as $chunk) {
            $result .= $chunk['data']->getData();
        }
        return $result;
    }
1026891
public function formatListDetails(): string
    {
        ob_start();
        FunctionsPrintFacts::printMediaLinks($this->tree(), '1 OBJE @' . $this->xref() . '@', 1);

        return ob_get_clean();
    }
883188
public function getTotalsRowHTML()
    {
        $output = [];
        foreach ($this->columns as $name => $column) {
            // if no totals plan, then show dash, but keep column formatting
            if (!isset($this->totals_plan[$name])) {
                $output[] = $column->getTag('foot', '-');
                continue;
            }

            // if totals plan is set as array, then show formatted value
            if (is_array($this->totals_plan[$name])) {
                // todo - format
                $field = $this->model->getElement($name);
                $output[] = $column->getTotalsCellHTML($field, $this->totals[$name]);
                continue;
            }

            // otherwise just show it, for example, "Totals:" cell
            $output[] = $column->getTag('foot', $this->totals_plan[$name]);
        }

        return implode('', $output);
    }
1144201
public function outputAr()
    {
        $aOut = [];

        foreach ($this->aEntries as $aEntry) {

            $sTemp = !empty($aEntry['tag']) ? '<' . $aEntry['tag'] . ' ' : '<meta ';
            unset($aEntry['tag']);
            foreach ($aEntry as $sKey => $sValue) {

                $sTemp .= $sKey . '="' . $sValue . '" ';
            }
            $sTemp  = trim($sTemp) . '>';
            $aOut[] = $sTemp;
        }

        return $aOut;
    }
571421
public function toDatatablesString() {
		$string = "";
		$fields = $this::getFields ();
		foreach ( $fields as $field ) {
			$value = call_user_func ( array (
					$this,
					'get' . $field 
			) );
			if ($value instanceof \DateTime) {
				$value = $value->format ( 'Y-m-d' );
			}
			$string .= $value . ",";
		}
		$string = trim ( $string, "," );
		$string = str_replace ( "\n", "", $string );
		return $string;
	}
392
protected function output()
    {
        $attrs   = '';
        $classes = 'fa-layers-text';
        $transforms = '';

        if (!empty($this->classes) && count($this->classes) > 0) {
            $classes .= ' ' . implode(' ', $this->classes);
        }

        if (!empty($this->attributes) && count($this->attributes) > 0) {
            foreach ($this->attributes as $attr => $val) {
                $attrs .= ' ' . $attr . '="' . $val . '"';
            }
        }

        if (!empty($this->transforms) && count($this->transforms) > 0) {
            $transformList = array();
            foreach ($this->transforms as $transform) {
                $transformList[] = implode('-', $transform);
            }
            $transforms = ' data-fa-transform="' . implode(' ', $transformList) . '"';
        }

        return sprintf(self::TEXT_HTML, $classes, $attrs, $transforms, $this->text);
    }
1152213
public function toString()
    {
        $adapter = $this->getAdapter();
        $prefix  = $adapter->getTablePrefix();
        $query   = 'SELECT';

        if($this->columns)
        {
            if($this->distinct) {
                $query .= ' DISTINCT';
            }

            $columns = array();
            foreach($this->columns as $alias => $column)
            {
                if($column instanceof KDatabaseQuerySelect) {
                    $columns[] = '('.$column.')'.(is_string($alias) ? ' AS '.$adapter->quoteIdentifier($alias) : '');
                } else {
                    $columns[] = $adapter->quoteIdentifier($column.(is_string($alias) ? ' AS '.$alias : ''));
                }
            }

            $query .= ' '.implode(', ', $columns);
        }
        else $query .= ' *';

        if($this->table)
        {
            if(current($this->table) instanceof KDatabaseQuerySelect) {
                $table= '('.current($this->table).')'.(!is_numeric(key($this->table)) ? ' AS '.$adapter->quoteIdentifier(key($this->table)) : '');
            } else {
                $table = $adapter->quoteIdentifier($prefix.current($this->table).(!is_numeric(key($this->table)) ? ' AS '.key($this->table) : ''));
            }

            $query .= ' FROM '.$table;
        }

        if($this->join)
        {
            $joins = array();
            foreach($this->join as $alias => $join)
            {
                $tmp = '';

                if($join['type']) {
                    $tmp .= ' '.$join['type'];
                }

                if($join['table'] instanceof KDatabaseQuerySelect) {
                    $tmp .= ' JOIN ('.$join['table'].')'.(is_string($alias) ? ' AS '.$adapter->quoteIdentifier($alias) : '');
                } else {
                    $tmp .= ' JOIN '.$adapter->quoteIdentifier($prefix.$join['table'].(is_string($alias) ? ' AS '.$alias : ''));
                }

                if($join['condition']) {
                    $tmp .= ' ON ('.$adapter->quoteIdentifier($join['condition']).')';
                }

                $joins[] = $tmp;
            }

            $query .= implode('', $joins);
        }

        if($this->where)
        {
            $query .= ' WHERE';

            foreach($this->where as $where)
            {
                if($where['combination']) {
                    $query .= ' '.$where['combination'];
                }

                $query .= ' '. $adapter->quoteIdentifier($where['condition']);
            }
        }

        if($this->group)
        {
            $columns = array();
            foreach($this->group as $column) {
                $columns[] = $adapter->quoteIdentifier($column);
            }

            $query .= ' GROUP BY '.implode(' , ', $columns);
        }

        if($this->having)
        {
            $columns = array();
            foreach($this->having as $column) {
                $columns[] = $adapter->quoteIdentifier($column);
            }

            $query .= ' HAVING '.implode(' , ', $columns);
        }

        if($this->order)
        {
            $query .= ' ORDER BY ';

            $list = array();
            foreach($this->order as $order) {
                $list[] = $adapter->quoteIdentifier($order['column']).' '.$order['direction'];
            }

            $query .= implode(' , ', $list);
        }

        if($this->limit) {
            $query .= ' LIMIT '.$this->offset.' , '.$this->limit;
        }

        if($this->_parameters) {
            $query = $this->_replaceParams($query);
        }

        return $query;
    }
290356
public function formatOutputRecord($data, $model=null)
    {
        $model = $model ? : $this;
        
        if (!$data || !isset($model['primary_key']) || !isset($model['fields'])) {
            return $data;
        }
        
        $fields_names = array_keys($model['fields']);
        foreach ($data as $k => $v){
            if (in_array($k, $fields_names)) {
                $data[$k] = FieldOutputHandler::formatValue($model['fields'][$k], $v);
            }
        }
        
        return $data;
    }
373058
public function formatOutput($data, $model=null)
    {
        if ($data) {
            if (is_numeric(key($data))) {
                foreach ($data as $k => $v){
                    if (is_numeric($k) && is_array($v)) {
                        $data[$k] = static::formatOutputRecord($v, $model);
                    }
                }
            } else {
                $data = static::formatOutputRecord($data, $model);
            }
        }
        
        return $data;
    }
214538
def _format_list(self, data):
        
        dataset = "["
        i = 0
        for el in data:
            if pd.isnull(el):
                dataset += "null"
            else:
                dtype = type(data[i])
                if dtype == int or dtype == float:
                    dataset += str(el)
                else:
                    dataset += '"' + el + '"'
            if i < len(data) - 1:
                dataset += ', '
        dataset += "]"
        return dataset
126146
static function data_output ( $columns, $data )
	{
		$out = array();

		for ( $i=0, $ien=count($data) ; $i<$ien ; $i++ ) {
			$row = array();

			for ( $j=0, $jen=count($columns) ; $j<$jen ; $j++ ) {
				$column = $columns[$j];

				// Is there a formatter?
				if ( isset( $column['formatter'] ) ) {
					$row[ $column['dt'] ] = $column['formatter']( $data[$i][ $column['db'] ], $data[$i] );
				}
				else {
					$row[ $column['dt'] ] = $data[$i][ $columns[$j]['db'] ];
				}
			}

			$out[] = $row;
		}

		return $out;
	}
1055440
public function getEditableDataString() {
        $valuePairs = array();
        if ($this->values) {
            foreach ($this->values as $value) {
                $valuePairs[] = '\''.$value['label'].'\':\''.$value['value'].'\'';
            }
        }
        return '{'.join(', ',$valuePairs).'}';
    }
1000363
public function format()
    {
        return array_merge($this->options, [
            'data'  => $this->values,
            'label' => $this->name,
            'type'  => $this->type,
        ]);
    }
695183
protected function aggregateData()
    {
        $data = [
            'iso_code'            => $this->isoCode,
            'name'                => $this->name,
            'symbol'              => $this->symbol,
            'subunit'             => $this->subunit,
            'symbol_first'        => $this->symbolFirst,
            'html_entity'         => $this->htmlEntity,
            'decimal_mark'        => $this->decimalMark,
            'thousands_separator' => $this->thousandsSeparator,
            'iso_numeric'         => $this->isoNumeric,
        ];

        if (!is_null($this->alternateSymbols)) {
            $data['alternate_symbols'] = $this->alternateSymbols;
        }

        if (!is_null($this->disambiguateSymbol)) {
            $data['disambiguate_symbol'] = $this->disambiguateSymbol;
        }

        return $data;
    }
1315077
public function getDataset()
    {
        $dataset = array();

        $attributes = $this->getAttributes();

        foreach ($attributes as $attribute) {

            $attributeName = $attribute->getName();
            $attribute->setAccessible(true);
            $attributeValue = $attribute->getValue($this);

            if (MWebfile::isSimpleDatatype($attributeName)) {
                $attributeFieldName = static::getSimplifiedAttributeName($attributeName);
                $dataset[$attributeFieldName] = $attributeValue;
            }
        }
        return $dataset;
    }