lib/IgraalOSL/StatsTable/StatsTableBuilder.php
public function appendTable(
        $table,
        $headers,
        $formats,
        $aggregations,
        $columnNames = [],
        $defaultValues = [],
        $metaData = []
    ) {
        $this->defaultValues = array_merge($this->defaultValues, $defaultValues);

        if (count($columnNames) === 0 && count($table) !== 0) {
            $columnNames = array_keys(reset($table));
        }

        if (count($columnNames) === 0 && count($headers) !== 0) {
            $columnNames = array_keys($headers);
        }

        foreach ($columnNames as $columnName) {
            $column = new StatsColumnBuilder(
                $this->getAssocColumn($table, $columnName),
                $this->getParameter($headers, $columnName, $columnName),
                $this->getParameter($formats, $columnName),
                $this->getParameter($aggregations, $columnName),
                $this->getParameter($metaData, $columnName, [])
            );

            if (count($this->defaultValues)) {
                $column->insureIsFilled($this->indexes, $this->defaultValues[$columnName]);
            }

            $this->columns[$columnName] = $column;
        }
    }
public function appendTable(
        $table,
        $headers,
        $formats,
        $aggregations,
        $columnNames = [],
        $defaultValues = [],
        $metaData = []
    ) {
        $this->defaultValues = array_merge($this->defaultValues, $defaultValues);

        if (count($columnNames) === 0 && count($table) !== 0) {
            $columnNames = array_keys(reset($table));
        }

        if (count($columnNames) === 0 && count($headers) !== 0) {
            $columnNames = array_keys($headers);
        }

        foreach ($columnNames as $columnName) {
            $column = new StatsColumnBuilder(
                $this->getAssocColumn($table, $columnName),
                $this->getParameter($headers, $columnName, $columnName),
                $this->getParameter($formats, $columnName),
                $this->getParameter($aggregations, $columnName),
                $this->getParameter($metaData, $columnName, [])
            );

            if (count($this->defaultValues)) {
                $column->insureIsFilled($this->indexes, $this->defaultValues[$columnName]);
            }

            $this->columns[$columnName] = $column;
        }
    }
public function appendTable ( $ table , $ headers , $ formats , $ aggregations , $ columnNames = [ ] , $ defaultValues = [ ] , $ metaData = [ ] ) { $ this -> defaultValues = array_merge ( $ this -> defaultValues , $ defaultValues ) ; if ( count ( $ columnNames ) === 0 && count ( $ table ) !== 0 ) { $ columnNames = array_keys ( reset ( $ table ) ) ; } if ( count ( $ columnNames ) === 0 && count ( $ headers ) !== 0 ) { $ columnNames = array_keys ( $ headers ) ; } foreach ( $ columnNames as $ columnName ) { $ column = new StatsColumnBuilder ( $ this -> getAssocColumn ( $ table , $ columnName ) , $ this -> getParameter ( $ headers , $ columnName , $ columnName ) , $ this -> getParameter ( $ formats , $ columnName ) , $ this -> getParameter ( $ aggregations , $ columnName ) , $ this -> getParameter ( $ metaData , $ columnName , [ ] ) ) ; if ( count ( $ this -> defaultValues ) ) { $ column -> insureIsFilled ( $ this -> indexes , $ this -> defaultValues [ $ columnName ] ) ; } $ this -> columns [ $ columnName ] = $ column ; } }
Append columns given a table

@param array                  $table
@param string[]               $headers
@param string[]               $formats
@param AggregationInterface[] $aggregations
@param string[]               $columnNames
@param mixed[]                $defaultValues
Append columns given a table