Loads the purifier behavior for the given table if not already attached.

@param \Cake\ORM\Table $table Table object.
@param array Set of fields to sanitize
@return void
174957
protected function _loadBehavior(Table $table, $fields)
    {
        if (!in_array('HtmlPurifier', $table->behaviors()->loaded())) {
            $table->addBehavior('Burzum/HtmlPurifier.HtmlPurifier', [
                'fields' => $fields,
                'purifierConfig' => $this->param('config')
            ]);
        }
    }
409599
protected function createTable(Table $table): void
	{
		$table->addPrimaryKey('id')
			->int()
			->setAutoIncrement();
		$table->addForeignKey('groupId', PagesLinksGroupsMapper::class);
		$table->addColumn('name')
			->text();
		$table->addColumn('url')
			->varChar();
		$table->addColumn('content')
			->text()
			->setDefault(null);
		$table->addColumn('description')
			->text()
			->setDefault(null);
		$table->addColumn('image')
			->varChar()
			->setDefault(null);
		$table->addColumn('position')
			->int(3);
		$table->addColumn('visible')
			->bool()
			->setDefault(1);
		$table->addColumn('openNewWindow')
			->bool()
			->setDefault(0);
	}
420554
private function createTable(Table $table)
    {
        if ($this->getSqlStatements) {
            $createFlags = AbstractPlatform::CREATE_INDEXES |
                AbstractPlatform::CREATE_FOREIGNKEYS;
            $this->addSql(
                $this->getPlatform()
                    ->getCreateTableSQL($table, $createFlags)
            );
        } else {
            $this->schemaManager->createTable($table);
        }
    }
1135333
public function loadDataContainer($table)
    {
        if (!$this->database->tableExists($table)) {
            return;
        }

        if (!isset($GLOBALS['TL_DCA'][$table]) || !isset($GLOBALS['TL_DCA'][$table]['config']['treeCache']) || !\is_array($GLOBALS['TL_DCA'][$table]['config']['treeCache'])) {
            return;
        }

        $configurations = $GLOBALS['TL_DCA'][$table]['config']['treeCache'];

        foreach ($configurations as $key => $config) {
            $this->addConfigToTreeCache($table, $key, $config);
        }
    }
123775
protected function cleanDatabase(array $tables)
    {
        DB::statement($this->getForeignKeyCheck(false));
        foreach ($tables as $table) {
            if (Schema::hasTable($table)) {
                DB::table($table)->truncate();
            }
        }
        DB::statement($this->getForeignKeyCheck(true));
    }
535641
protected function filterValues($table, array $data)
    {
        $scheme = $this->getScheme($table);
        $values = array_intersect_key($data, $scheme['fields']);

        if (empty($values)) {
            return array();
        }

        foreach ($values as $field => &$value) {

            if (!empty($scheme['fields'][$field]['auto_increment'])) {
                unset($values[$field]);
                continue;
            }

            if (is_null($value) && !empty($scheme['fields'][$field]['not_null'])) {
                unset($values[$field]);
                continue;
            }

            if (!empty($scheme['fields'][$field]['serialize'])) {
                if (!is_array($value)) {
                    $value = array();
                }
                $value = serialize($value);
            }
        }

        return $values;
    }
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);
	}
1298049
public function setBannedWordsTable($table){
        if(is_string($table)){
            $this->banned_words_table = filter_var($table, FILTER_SANITIZE_STRING);
        }
        return $this;
    }
402674
protected function loadCacheInformation($table = null)
    {
        $schema = $this->schema;
        $this->checkTableArgument($table);

        if (!in_array($schema, self::$fullyCachedSchemas)) {
            if ($table !== null) {
                $this->getTableConfig($table);
            } else {
                $this->getSchemaConfig();
            }
        } elseif ($table !== null) {
            // Just in case to check if table exists
            $this->getTableConfig($table);
        }
    }
922119
public function filter($table)
    {
        foreach ($table->getRows() as $row) {
            $value = $this->getDividend($row);
            if ($value === false && $this->shouldSkipRows) {
                continue;
            }

            // Delete existing column if it exists
            $existingValue = $row->getColumn($this->columnNameToAdd);
            if ($existingValue !== false) {
                continue;
            }

            $divisor = $this->getDivisor($row);

            $formattedValue = $this->formatValue($value, $divisor);
            $row->addColumn($this->columnNameToAdd, $formattedValue);

            $this->filterSubTable($row);
        }
    }
1311081
public function filter($table)
    {
        $row = $table->getRowFromId(DataTable::ID_SUMMARY_ROW);
        if ($row) {
            $row->setColumn('label', $this->newLabel);
        } else {
            $row = $table->getRowFromLabel(DataTable::LABEL_SUMMARY_ROW);
            if ($row) {
                $row->setColumn('label', $this->newLabel);
            }
        }

        // recurse
        foreach ($table->getRowsWithoutSummaryRow() as $row) {
            $subTable = $row->getSubtable();
            if ($subTable) {
                $this->filter($subTable);
            }
        }
        
       
        $summaryRow = $table->getRowFromId(DataTable::ID_SUMMARY_ROW);
        if (!empty($summaryRow)) {
            $subTable = $summaryRow->getSubtable();
            if ($subTable) {
                $this->filter($subTable);
            }
        }
    }
836924
public function getNullableFields(Table $table)
    {
        return $table->getFields()->filter(function (Field $field) {
            return $field->isNullable();
        });
    }
737674
public function displayTable($table)
    {
        $headers = $this->makeHeaders($table[0]);

        $rows = [];

        foreach ($table as $row) {
            $rows[] = (array) $row;
        }

        $this->table = $this->getHelperSet()->get('table');

        $this->table->setHeaders($headers)->setRows($rows);

        $this->table->render($this->getOutput());
    }
1001041
public function filter($table)
    {
        if ($this->truncateAfter < 0) {
            return;
        }

        $this->addSummaryRow($table);
        $table->queueFilter('ReplaceSummaryRowLabel', array($this->labelSummaryRow));

        if ($this->filterRecursive) {
            foreach ($table->getRowsWithoutSummaryRow() as $row) {
                if ($row->isSubtableLoaded()) {
                    $this->filter($row->getSubtable());
                }
            }
        }
    }
1101411
public function collect(Table $table)
    {
        $this->createTableQueries = array_merge(
            $this->createTableQueries,
            $this->platform->getCreateTableSQLQueries($table, array('foreign_key' => false))
        );

        foreach ($table->getForeignKeys() as $foreignKey) {
            $this->createForeignKeyQueries = array_merge(
                $this->createForeignKeyQueries,
                $this->platform->getCreateForeignKeySQLQueries($foreignKey, $table->getName())
            );
        }
    }
1347043
public function filter($table)
    {
        // always do recursive filter
        $this->enableRecursive(true);
        $recurse = false; // only recurse if there are columns to remove/keep

        // remove columns specified in $this->columnsToRemove
        if (!empty($this->columnsToRemove)) {
            $this->removeColumnsFromTable($table);
            $recurse = true;
        }

        // remove columns not specified in $columnsToKeep
        if (!empty($this->columnsToKeep)) {
            foreach ($table as $index => $row) {
                $columnsToDelete = array();
                foreach ($row as $name => $value) {
                    $keep = false;

                    // @see self::APPEND_TO_COLUMN_NAME_TO_KEEP
                    foreach ($this->columnsToKeep as $nameKeep => $true) {
                        if (strpos($name, $nameKeep . self::APPEND_TO_COLUMN_NAME_TO_KEEP) === 0) {
                            $keep = true;
                        }
                    }

                    if (!$keep
                        && $name != 'label' // label cannot be removed via whitelisting
                        && !isset($this->columnsToKeep[$name])
                    ) {
                        // we cannot remove row directly to prevent notice "ArrayIterator::next(): Array was modified
                        // outside object and internal position is no longer valid in /var/www..."
                        $columnsToDelete[] = $name;
                    }
                }
                foreach ($columnsToDelete as $columnToDelete) {
                    unset($table[$index][$columnToDelete]);
                }
            }

            $recurse = true;
        }

        // recurse
        if ($recurse && !is_array($table)) {
            foreach ($table as $row) {
                $this->filterSubTable($row);
            }
        }

        return $table;
    }
1125992
public function initialize(Table $table)
    {
        $this->table = $table;

        if (!$this->builder instanceof ActionBuilder) {
            $this->builder = new ActionBuilder($this->table);
        }
    }