Generates the object structure for the head

@access protected
@param \Zepi\Web\UserInterface\Table\TableAbstract $table
@param \Zepi\DataSource\Core\Entity\DataRequest $dataRequest
@return \Zepi\Web\UserInterface\Table\Head
188544
protected function renderHead(TableAbstract $table, DataRequest $dataRequest)
    {
        $head = new Head();

        // Add the name row
        $row = new Row($head);
        foreach ($table->getColumns() as $column) {
            $cell = new Cell($column, $row, $column->getName());
            
            $row->addCell($cell);
        }
        
        $head->addRow($row);
        
        return $head;
    }
737986
public function setRequestFormParams(TableNode $table) {
        if (!isset($this->requestOptions['form_params'])) {
            $this->requestOptions['form_params'] = [];
        }

        foreach ($table as $row) {
            $name = $row['name'];
            $value = $row['value'];

            if (isset($this->requestOptions['form_params'][$name]) && !is_array($this->requestOptions['form_params'][$name])) {
                $this->requestOptions['form_params'][$name] = [$this->requestOptions['form_params'][$name]];
            }

            if (isset($this->requestOptions['form_params'][$name])) {
                $this->requestOptions['form_params'][$name][] = $value;
            } else {
                $this->requestOptions['form_params'][$name] = $value;
            }
        }

        return $this;
    }
827372
protected function renderTable($table)
    {
        if (is_array($table)) {
            // convert array to DataTable

            $table = DataTable::makeFromSimpleArray($table);
        }

        if ($table instanceof DataTable\Map) {
            foreach ($table->getDataTables() as $date => $subtable) {
                if ($subtable->getRowsCount()) {
                    $this->buildTableStructure($subtable, '_' . $table->getKeyName(), $date);
                }
            }
        } else {
            // Simple

            if ($table->getRowsCount()) {
                $this->buildTableStructure($table);
            }
        }

        $out = $this->renderDataTable();
        return $out;
    }
837827
public function addTable($table)
    {
        if (!in_array($table, $this->tables))
        {
            $this->tables[] = $table;
        }

        return $this;
    }
1349559
private function createColumns(Table $table)
    {
        $table->addColumn(RdsDeliveryExecutionService::COLUMN_ID, Type::STRING, ["length" => 255, "notnull" => true]);
        $table->addColumn(RdsDeliveryExecutionService::COLUMN_DELIVERY_ID, Type::STRING, ["length" => 255, "notnull" => true]);
        $table->addColumn(RdsDeliveryExecutionService::COLUMN_USER_ID, Type::STRING, ["length" => 255, "notnull" => true]);
        $table->addColumn(RdsDeliveryExecutionService::COLUMN_LABEL, Type::STRING, ["length" => 255, "notnull" => true]);
        $table->addColumn(RdsDeliveryExecutionService::COLUMN_STATUS, Type::STRING, ["length" => 255, "notnull" => true]);
        $table->addColumn(RdsDeliveryExecutionService::COLUMN_STARTED_AT, Type::DATETIME, ["notnull" => true]);
        $table->addColumn(RdsDeliveryExecutionService::COLUMN_FINISHED_AT, Type::DATETIME, ["notnull" => false]);
        $table->setPrimaryKey([RdsDeliveryExecutionService::COLUMN_ID]);
    }
953201
protected function table( $table )
	{
		return $this->db->connection( $this->connection )->table( $table )->useWritePdo();
	}
144434
protected function renderTable($table)
    {
        $array = array();

        foreach ($table->getRows() as $id => $row) {
            $newRow = array(
                'columns'        => $row->getColumns(),
                'metadata'       => $row->getMetadata(),
                'idsubdatatable' => $row->getIdSubDataTable(),
            );

            if ($id == DataTable::ID_SUMMARY_ROW) {
                $newRow['issummaryrow'] = true;
            }

            $subTable = $row->getSubtable();
            if ($this->isRenderSubtables()
                && $subTable
            ) {
                $subTable = $this->renderTable($subTable);
                $newRow['subtable'] = $subTable;
                if ($this->hideIdSubDatatable === false
                    && isset($newRow['metadata']['idsubdatatable_in_db'])
                ) {
                    $newRow['columns']['idsubdatatable'] = $newRow['metadata']['idsubdatatable_in_db'];
                }
                unset($newRow['metadata']['idsubdatatable_in_db']);
            }
            if ($this->hideIdSubDatatable !== false) {
                unset($newRow['idsubdatatable']);
            }

            $array[] = $newRow;
        }
        return $array;
    }
1059310
public function renderTableNode(TableNode $table)
    {
        $arguments = '<table class="argument"> <thead>';
        $header = $table->getRow(0);
        $arguments .= $this->preintTableRows($header);

        $arguments .= '</thead><tbody>';
        foreach ($table->getHash() as $row) {
            $arguments .= $this->preintTableRows($row);
        }

        $arguments .= '</tbody></table>';

        return $arguments;
    }
385756
public function table($table)
    {
        $this->table = $table;
        $alias = $this->alias ?? $this->table;

        if (!in_array('`' . $table . '`.*', $this->select) && !in_array('`' . $alias . '`.*', $this->select)) {
            $this->select[] = '`' . $table . '`.*';
        }

        return $this;
    }
277772
public function update($table) {
        $obj = new UpdateRule(new Context($this->connection));
        return $obj->update($table);
    }
898932
public function table(Table\Table $table)
    {
        // INitilisation du CSV
        $csv = Writer::createFromFileObject(new \SplTempFileObject());


        // gestion des colonne
        $header = $columns = [];
        foreach ($table->getColumns() as $index => $column) {

            // Seule les colonnes Exportable peuvent être exporté
            if ($column instanceof Exportable) {
                $columns[$index] = $column;
                $header[$index] = $column->getLabel();
            }
        }

        // insertion du header
        $csv->insertOne(array_values($header));

        //@todo mettre en place un streaming pour économiser la memoire

        // insertion des lignes
        foreach ($table->getRows() as $row) {
            $line = [];
            foreach (array_keys($header) as $index) {
                $line[] = $columns[$index]->getValue($row);
            }
            $csv->insertOne($line);
        }
        $csv->output($table->getFilename());
        exit;
    }
123655
public function putTable(Table $table)
    {
        $this->tables->set('tables', $table->getName(), $table);
        return $this;
    }
1351524
protected function newTable($table = null)
    {
        return new Table(
            static::$dbManager,
            $this->connectionName,
            $table ? : $this->tableName,
            static::$dbManager->getStructure($this->connectionName)
        );
    }
351649
public function insert($table, array $data)
    {
        $nameFields = join(',', array_keys($data));
        $preparedValues = $this->prepareValues($data);
        $keyValues = join(",", array_keys($preparedValues));
        $queryString = "INSERT INTO {$table} ({$nameFields}) VALUES ({$keyValues});";

        $this->query($queryString, $preparedValues);

        return $this->getInsertId();
    }
104405
public function importTable($table)
    {
        $this->table($table);
        $has_fields = false;
        foreach ($this->describeTable($table) as $row) {
            $has_fields = true;
            if ($row['pk']) {
                $this->id($row['name']);
                continue;
            }

            $type = $this->getModelFieldType($row['type']);

            $this->field($row['name'], ['type'=>$type]);
        }

        return $has_fields;
    }
608475
protected function renderRow(TableAbstract $table, Body $body, $object)
    {
        $row = new Row($body);
        foreach ($table->getColumns() as $column) {
            $value = $table->getDataForRow($column->getKey(), $object);
            
            $cell = new Cell($column, $row, $value);
            
            $row->addCell($cell);
        }
        
        return $row;
    }
460141
public function table($table) {
        $query = new Builder($this, $this->getQueryGrammar());

        return $query->from($table);
    }