See {@link PrependValueToMetadata}.

@param DataTable $table
194534
public function filter($table)
    {
        if (empty($this->metadataColumn) || empty($this->valueToPrepend)) {
            return;
        }

        $metadataColumn = $this->metadataColumn;
        $valueToPrepend = $this->valueToPrepend;

        $table->filter(function (DataTable $dataTable) use ($metadataColumn, $valueToPrepend) {
            foreach ($dataTable->getRows() as $row) {
                $filter = $row->getMetadata($metadataColumn);
                if ($filter !== false) {
                    $row->setMetadata($metadataColumn, $valueToPrepend . $filter);
                }
            }
        });
    }
696934
public function addFilesToData(&$data, $table = "tt_content")
    {
        if ($data["_LOCALIZED_UID"]) {
            $uid = $data["_LOCALIZED_UID"];
        } else {
            $uid = $data["uid"];
        }

        // using is_numeric in favor to is_int
        // due to some rare cases where uids are provided as strings
        if (!is_numeric($uid)) {
            return;
        }
        $fieldHelper = GeneralUtility::makeInstance('MASK\\Mask\\Helper\\FieldHelper');
        if (!$this->objectManager) {
            $this->objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
        }

        $storage = $this->storageRepository->load();
        /* @var $fileRepository \TYPO3\CMS\Core\Resource\FileRepository */
        $fileRepository = $this->objectManager->get("TYPO3\CMS\Core\Resource\FileRepository");
        $contentFields = array("media", "image", "assets");
        if ($storage[$table]["tca"]) {
            foreach ($storage[$table]["tca"] as $fieldKey => $field) {
                $contentFields[] = $fieldKey;
            }
        }
        if ($contentFields) {
            foreach ($contentFields as $fieldKey) {
                if ($fieldHelper->getFormType($fieldKey, "", $table) == "File") {
                    $data[$fieldKey] = $fileRepository->findByRelation($table, $fieldKey, $uid);
                }
            }
        }
    }
350700
private function removeSubtableMetadata($dataTable)
    {
        if ($dataTable instanceof DataTable\Map) {
            foreach ($dataTable->getDataTables() as $childTable) {
                $this->removeSubtableMetadata($childTable);
            }
        } else {
            foreach ($dataTable->getRows() as $row) {
                $row->deleteMetadata('idsubdatatable_in_db');
            }
        }
    }
254128
public void setTable(final Table table) {
        if (table != _tableRef.get()) {
            _tableRef.set(table);

            if (table == null) {
                _comboBox.setEmptyModel();
            } else {
                _comboBox.setModel(table);
            }
        }
    }
1226611
protected function insertPrepared( $table, $rows ) {

        $columns = $this->getColumns( $rows );
        if ( empty( $columns ) ) return;

        $query = $this->insertHead( $table, $columns );
        $query .= "( ?" . str_repeat( ", ?", count( $columns ) - 1 ) . " )";

        $statement = $this->prepare( $query );

        foreach ( $rows as $row ) {

            $values = array();

            foreach ( $columns as $column ) {

                $value = (string) $this->format( @$row[ $column ] );
                $values[] = $value;

            }

            $this->onQuery( $query, $values );

            $statement->execute( $values );

        }

        return $statement;

    }
68559
public function setTable($table)
    {
        if (!is_array($table)
            && !($table instanceof DataTableInterface)
        ) {
            throw new Exception("DataTable renderers renderer accepts only DataTable, Simple and Map instances, and arrays.");
        }
        $this->table = $table;
    }
115882
public function set($table, $data, $tablePrefix = null)
    {
        is_null($tablePrefix) && $tablePrefix = $this->tablePrefix;
        $tableName = $tablePrefix . $table;
        if (is_array($data)) {
            $s = $this->arrToCondition($data);
            $this->currentQueryIsMaster = true;
            $stmt = $this->prepare("INSERT INTO {$tableName} SET {$s}", $this->wlink);
            $this->execute($stmt);

            $this->setCacheVer($tableName);
            return $this->insertId();
        } else {
            return false;
        }
    }
1361683
public function prepareInsert($table, array $data)
    {
        $data += $this->getDefaultValues($table);
        return $this->filterValues($table, $data);
    }
1015151
public function buildSpecificDefinition(TableStructure $table): void
    {
        parent::buildSpecificDefinition($table);

        if ($table->generalSchema) {
            $this->definition[] = 'unsigned()';
            $this->isUnsignedPossible = false;
        }
    }
531257
public function prepend($value)
	{
		$value = $this->normalizeValue($value);

		array_unshift($this->items, $value);

		return $value;
	}
413322
public function buildSpecificDefinition(TableStructure $table): void
    {
        $this->definition[] = 'bigPrimaryKey(' . ($table->generalSchema ? null : $this->length) . ')';
        if ($table->generalSchema) {
            $this->isPkPossible = false;
            $this->isNotNullPossible = false;
        }
    }
962277
function ( cell, val ) {
			var table = $(cell).parents('table');
			if ( DataTable.Api ) {
				// 1.10
				table.DataTable().cell( cell ).data( val );
			}
			else {
				// 1.9
				var dt = table.dataTable();
				var pos = dt.fnGetPosition( cell );
				dt.fnUpdate( val, pos[0], pos[2], false );
			}
		}
332145
protected function _parseDataToTable($data)
    {   
        
        $values = array();
        if (is_scalar($data)) {             // 1 scalar
            preg_match('/(.*)(\,|left\sjoin|inner\sjoin)+(.*)/i', $data, $matches);
            if ($matches) {
                $temp1 = $this->_parseDataToTable($matches[1]);
                $temp2 = $this->_parseDataToTable($matches[3]);
                $values[] = $temp1[0] . ' ' . $matches[2] . ' ' . $temp2[0];
            } else {
                $values[] = $this->formatTableName($data);
            }
        } elseif (is_array($data)) {        // 2 array
            foreach ($data as $key => $value) {
                
                if ((is_numeric($key) || empty($key)) && $value) {
                    $temp = $this->_parseDataToTable($value);
                    $values = array_merge($values, $temp);
                }
            }
        }
        
        return $values;
    }
516993
protected function renderDataTable($table)
    {
        if ($table->getRowsCount() == 0) {
            return "<strong><em>Empty table</em></strong><br />\n";
        }

        $i = 1;
        $tableStructure = array();

        /*
         * table = array
         * ROW1 = col1 | col2 | col3 | metadata | idSubTable
         * ROW2 = col1 | col2 (no value but appears) | col3 | metadata | idSubTable
         * 		subtable here
         */
        $allColumns = array();
        foreach ($table->getRows() as $row) {
            foreach ($row->getColumns() as $column => $value) {
                // for example, goals data is array: not supported in export RSS
                // in the future we shall reuse ViewDataTable for html exports in RSS anyway
                if (is_array($value)) {
                    continue;
                }
                $allColumns[$column] = true;
                $tableStructure[$i][$column] = $value;
            }
            $i++;
        }
        $html = "\n";
        $html .= "<table border=1 width=70%>";
        $html .= "\n<tr>";
        foreach ($allColumns as $name => $toDisplay) {
            if ($toDisplay !== false) {
                if ($this->translateColumnNames) {
                    $name = $this->translateColumnName($name);
                }
                $html .= "\n\t<td><strong>$name</strong></td>";
            }
        }
        $html .= "\n</tr>";

        foreach ($tableStructure as $row) {
            $html .= "\n\n<tr>";
            foreach ($allColumns as $columnName => $toDisplay) {
                if ($toDisplay !== false) {
                    $value = "-";
                    if (isset($row[$columnName])) {
                        $value = urldecode($row[$columnName]);
                    }

                    $html .= "\n\t<td>$value</td>";
                }
            }
            $html .= "</tr>";
        }
        $html .= "\n\n</table>";
        return $html;
    }
252082
protected function buildTableStructure($table, $columnToAdd = null, $valueToAdd = null)
    {
        $i = $this->i;
        $someMetadata = false;
        $someIdSubTable = false;

        /*
         * table = array
         * ROW1 = col1 | col2 | col3 | metadata | idSubTable
         * ROW2 = col1 | col2 (no value but appears) | col3 | metadata | idSubTable
         */
        if (!($table instanceof DataTable)) {
            throw new Exception("HTML Renderer does not work with this combination of parameters");
        }
        foreach ($table->getRows() as $row) {
            if (isset($columnToAdd) && isset($valueToAdd)) {
                $this->allColumns[$columnToAdd] = true;
                $this->tableStructure[$i][$columnToAdd] = $valueToAdd;
            }

            foreach ($row->getColumns() as $column => $value) {
                $this->allColumns[$column] = true;
                $this->tableStructure[$i][$column] = $value;
            }

            $metadata = array();
            foreach ($row->getMetadata() as $name => $value) {
                if (is_string($value)) {
                    $value = "'$value'";
                } else if (is_array($value)) {
                    $value = var_export($value, true);
                }
                $metadata[] = "'$name' => $value";
            }

            if (count($metadata) != 0) {
                $someMetadata = true;
                $metadata = implode("<br />", $metadata);
                $this->tableStructure[$i]['_metadata'] = $metadata;
            }

            $idSubtable = $row->getIdSubDataTable();
            if (!is_null($idSubtable)) {
                $someIdSubTable = true;
                $this->tableStructure[$i]['_idSubtable'] = $idSubtable;
            }

            $i++;
        }
        $this->i = $i;

        $this->allColumns['_metadata'] = $someMetadata;
        $this->allColumns['_idSubtable'] = $someIdSubTable;
    }
413535
public function filter($table)
    {
        if ($this->deleteRowsWithNoVisit) {
            $this->deleteRowsWithNoVisit($table);
        }

        $extraProcessedMetrics = $table->getMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME);

        $extraProcessedMetrics[] = new ConversionRate();
        $extraProcessedMetrics[] = new ActionsPerVisit();
        $extraProcessedMetrics[] = new AverageTimeOnSite();
        $extraProcessedMetrics[] = new BounceRate();

        $table->setMetadata(DataTable::EXTRA_PROCESSED_METRICS_METADATA_NAME, $extraProcessedMetrics);
    }
396776
public function dropTable($table)
    {
        $changeSetElt = $this->createChangeSet('drop-table-' . $table->getName());
        $dropTableElt = $this->document->createElement('dropTable');

        $tableName = QualifiedName::fromAsset($table);

        if ($tableName->getNamespaceName()) {
            $dropTableElt->setAttribute('schemaName', $tableName->getNamespaceName());
        }
        $dropTableElt->setAttribute('tableName', $tableName->getName());
        // Should we add cascadeConstraints attribute ?
        // $dropTableElt->setAttribute('cascadeConstraints', 'false');

        $changeSetElt->appendChild($dropTableElt);
        $this->root->appendChild($changeSetElt);
    }