See {@link MetadataCallbackAddMetadata}.

@param DataTable $table
979531
public function filter($table)
    {
        if ($this->applyToSummaryRow) {
            $rows = $table->getRows();
        } else {
            $rows = $table->getRowsWithoutSummaryRow();
        }

        foreach ($rows as $key => $row) {
            $params = array();
            foreach ($this->metadataToRead as $name) {
                $params[] = $row->getMetadata($name);
            }

            $newValue = call_user_func_array($this->functionToApply, $params);
            if ($newValue !== false) {
                $row->addMetadata($this->metadataToAdd, $newValue);
            }
        }
    }
681327
public function loadDc(string $table)
    {
        if (!isset($GLOBALS['TL_DCA'][$table]) || null === $GLOBALS['TL_DCA'][$table]) {
            /** @var Controller $controller */
            $controller = $this->framework->getAdapter(Controller::class);

            $controller->loadDataContainer($table);
        }
    }
1258227
public void updateMetadata(String tableName, String metadata){
		try {
			updateStatement.setString(1, metadata);
			updateStatement.setLong(2, tableName.hashCode());
			updateStatement.executeUpdate();
		} catch (SQLException e) {
			throw new BackendException("Could not update metadata for table '" + tableName + "'", e);
		}
	}
1203206
protected function renderTable($table)
    {
        if (is_array($table)) {
            $array = $table;
            if (self::shouldWrapArrayBeforeRendering($array, $wrapSingleValues = true)) {
                $array = array($array);
            }

            foreach ($array as $key => $tab) {
                if ($tab instanceof DataTable\Map
                    || $tab instanceof DataTable
                    || $tab instanceof DataTable\Simple) {
                    $array[$key] = $this->convertDataTableToArray($tab);

                    if (!is_array($array[$key])) {
                        $array[$key] = array('value' => $array[$key]);
                    }
                }
            }
        } else {
            $array = $this->convertDataTableToArray($table);
        }

        if (!is_array($array)) {
            $array = array('value' => $array);
        }

        // decode all entities
        $callback = function (&$value, $key) {
            if (is_string($value)) {
                $value = html_entity_decode($value, ENT_QUOTES, "UTF-8");
            };
        };
        array_walk_recursive($array, $callback);

        // silence "Warning: json_encode(): Invalid UTF-8 sequence in argument"
        $str = @json_encode($array);

        if ($str === false
            && json_last_error() === JSON_ERROR_UTF8
            && $this->canMakeArrayUtf8()) {
            $array = $this->makeArrayUtf8($array);
            $str = json_encode($array);
        }

        return $str;
    }
53214
public function setTable(Table $table)
    {
        $this->_table = $table;
        $eventManager = $table->getEventManager();
        if ($eventManager !== null) {
            $this->setEventManager($eventManager);
        }
    }
573239
public function datatable(Table\Table $table)
    {

        $options = [];

        // Is remote loading
        if ($table->isRemote()) {
            $table->addClass('datatable-remote');
            $table->save();
            $options += [
                'ajax' => ['url' => route('datatable', ['token' => $table->getToken()])],
                'processing' => true,
                'serverSide' => true,
                'pageLength' => $table->getItemsPerPage(),
                'deferLoading' => $table->getItemsTotal()
            ];
        }

        //param par default
        $options += ['searching' => true];

        //Param dom datatable
        $dom = '';

        //header dom
        $dom .= '<"dataTables_wrapper no-footer"<"row"<"col-md-6 col-sm-12"lB>';
        // is a search is set
        if ($table->hasSearch()) {
            $dom .= '<"col-md-6 col-sm-12"f>';
        }
        $dom .= '>';

        //dom table
        $dom .= '<"table-scrollable"t>';

        //footer dom
        if ($table->hasFooter()) {

            $dom .= '<"row"<"col-md-5 col-sm-12"i><"col-md-7 col-sm-12"p>>';
        }
        
        //Set dom
        $options += ['dom' => $dom];


        // columns mamangement
        $columns = [];
        $order = [];
        $index = 0;
        $search = '';
        foreach($table->getColumns() as $c) {

            $data = [];

            /**@var Column\Column $c */
            $class = $c->getClasses();
            if (!empty($class)) {
                $data['className'] = trim($class);
            }

            // width
            if ($c->hasWidth()) {
                $data['width'] = $c->getWidth();
            }

            // other column attribute
            $data['orderable'] = $c->hasOrder();
            $data['searchable'] = $c->hasStrainer();
            $data['name'] = $c->getName();

            if ($data['searchable'] && !is_null($value = $c->getStrainer()->getValue())) {
				$value = is_bool($value) ? intval($value) : $value;
                $search[] = $value;
            } else {
                $search[] = null;
            }

            // set order for main table
            if ($c->hasOrderDirection()) {
                $order[] = [$index, $c->getOrderDirection()];
            }

            // set columns to null if column parameters is empty
            $columns[] = empty($data) ? null : $data;
            $index++;
        }

        if (!empty($columns)) {
            $options += ['columns' => $columns];
        }

        // buttons
        if ($table->hasDatatableButtons())
        {
            $options += ['buttons' => $table->getDatatableButtons()];
        }

        // main order foir the table
        $options['order'] = $order;

        js('onload', '#' . $table->getAttribute('id'), 'dtt', $options);

        // init search configuration - seartchcols doesn't work
        foreach($search as $i => $s) {
            if (is_null($s)) {continue;}
            js('onload',  '#' . $table->getAttribute('id'), 'DataTable().columns('.$i.').search', $s);
        }

        return '';
    }
773342
protected function loadMetadataForTable(Table $table)
    {
        $tblName = $table->getName();

        if (isset($this->defaultAliases[$tblName])) {
            $className = $this->defaultAliases[$tblName];
        } else {
            $className = $tblName;
            $this->unmapped[] = $tblName;
        }

        $contentKey = $this->getContentTypeFromAlias($table->getOption('alias'));
        $this->metadata[$className] = [];
        $this->metadata[$className]['identifier'] = $table->getPrimaryKey();
        $this->metadata[$className]['table'] = $table->getName();
        $this->metadata[$className]['boltname'] = $contentKey;
        if (isset($this->contenttypes[$contentKey]['class'])) {
            $this->metadata[$className]['class'] = $this->contenttypes[$contentKey]['class'];
        }
        foreach ($table->getColumns() as $colName => $column) {
            $mapping = [
                'fieldname'        => $column->getName(),
                'attribute'        => $this->camelize($column->getName()),
                'type'             => $column->getType()->getName(),
                'fieldtype'        => $this->getFieldTypeFor($contentKey, $column),
                'length'           => $column->getLength(),
                'nullable'         => !$column->getNotnull(),
                'platformOptions'  => $column->getPlatformOptions(),
                'precision'        => $column->getPrecision(),
                'scale'            => $column->getScale(),
                'default'          => $column->getDefault(),
                'columnDefinition' => $column->getColumnDefinition(),
                'autoincrement'    => $column->getAutoincrement(),
            ];

            $this->metadata[$className]['fields'][$colName] = $mapping;

            if (isset($this->contenttypes[$contentKey]['fields'][$colName])) {
                $this->metadata[$className]['fields'][$colName]['data'] = $this->contenttypes[$contentKey]['fields'][$colName];
            }
        }

        // This loop checks the contenttypes definition for any non-db fields and adds them.
        if ($contentKey && isset($this->contenttypes[$contentKey])) {
            $this->setRelations($contentKey, $className);
            $this->setIncomingRelations($contentKey, $className);
            $this->setTaxonomies($contentKey, $className);
            $this->setTemplatefields($contentKey, $className);
            $this->setRepeaters($contentKey, $className);
        }

        foreach ($this->getAliases() as $alias => $tablename) {
            if (array_key_exists($tablename, $this->metadata)) {
                $this->metadata[$alias] = $this->metadata[$tablename];
            } elseif (
                array_key_exists($tablename, $this->defaultAliases) &&
                array_key_exists($this->defaultAliases[$tablename], $this->metadata)
            ) {
                $this->metadata[$alias] = $this->metadata[$this->defaultAliases[$tablename]];
            }
        }
    }
1037992
public function switchTable($table=null)
	{
		static $tTable;
		if(null===$table)
		{
			if(null!==$tTable)
			{
				$this->table=$tTable;
				$tTable=null;
			}
		}
		else
		{
			$tTable=$this->table;
			$this->table=$table;
		}
		$this->loadFields($this->fields, $this->fieldNames, $this->pk, $this->bitFields);
	}
654242
public function handleMetadataLoad(MetadataLoadEvent $event)
    {
        $metadata = $event->getMetadata();

        if (false === $metadata->getReflectionClass()->isSubclassOf(RobotBehavior::class)) {
            return;
        }

        $metadata->addFieldMapping(
            'noFollow',
            [
                'encoding' => 'system',
                'property' => 'noFollow',
            ]
        );

        $metadata->addFieldMapping(
            'noIndex',
            [
                'encoding' => 'system',
                'property' => 'noIndex',
            ]
        );
    }
1339352
public function build(DataTable $table)
    {
        $this->qb->select($this->entityAlias);
        $this->qb->from($table->entityName, $this->entityAlias);
        $this->buildJoin($table->columns);

        if ($table->queryClosure) {
            call_user_func($table->queryClosure, $this->qb);
        }
    }
876773
public function addTableObject(TableMap $table)
    {
        $table->setDatabaseMap($this);
        $this->tables[$table->getName()] = $table;
        $this->tablesByPhpName[$table->getClassname()] = $table;
    }
101247
public static void deleteMetadata(GeoPackageCore geoPackage, String table) {

		MetadataReferenceDao metadataReferenceDao = geoPackage
				.getMetadataReferenceDao();
		try {
			if (metadataReferenceDao.isTableExists()) {
				metadataReferenceDao.deleteByTableName(table);
			}
		} catch (SQLException e) {
			throw new GeoPackageException(
					"Failed to delete Metadata extension. GeoPackage: "
							+ geoPackage.getName() + ", Table: " + table, e);
		}

	}
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);
    }
973292
public function thereArePosts(TableNode $table)
    {
        foreach ($table->getHash() as $postData) {
            if (!is_int(wp_insert_post($postData))) {
                throw new \InvalidArgumentException("Invalid post information schema.");
            }
        }
    }
1289036
@Override
    public void beginMetaData(MetaData metadata)
    {
        for (Listener listener : this.listeners) {
            listener.beginMetaData(metadata);
        }
    }
180247
public function setDataTable($datatable)
    {
        $this->setQuery($datatable->query());
        $this->datatable = $datatable;
        return $this;
    }
449111
public function initialize(Table $table)
    {
        $this->table = $table;
        $this->table->setData($this->getData());
    }