Generate the columns.

@param int           $value         Number of columns which should be generated.
@param DataContainer $dataContainer Data container driver.

@return null

@SuppressWarnings(PHPMD.UnusedFormalParameters)
195322
public function generateColumns($value, $dataContainer)
    {
        if (!$dataContainer->activeRecord) {
            return null;
        }

        /** @var FormModel|Result $current */
        $current = $dataContainer->activeRecord;

        if ($value && $dataContainer->activeRecord) {
            $stopElement  = $this->getStopElement($current);
            $nextElements = $this->getNextElements($stopElement);
            $sorting      = $stopElement->sorting;

            $sorting = $this->createSeparators($value, $current, $sorting);

            array_unshift($nextElements, $stopElement);
            $this->updateSortings($nextElements, $sorting);
        }

        return null;
    }
1121374
private function initializeDataContainer($table, $field)
    {
        // Define the current ID
        if (!defined('CURRENT_ID')) {
            define('CURRENT_ID', $table ? \Session::getInstance()->get('CURRENT_ID') : $field);
        }

        static::loadDataContainer($table);

        $this->dca     = &$GLOBALS['TL_DCA'][$table];
        $driverClass   = 'DC_' . $this->dca['config']['dataContainer'];
        $dataContainer = new $driverClass($table);

        $dataContainer->field = $field;

        if (!isset($this->dca['fields'][$field]) || $this->dca['fields'][$field]['inputType'] != 'icon') {
            throw new \RuntimeException('Invalid call. Field does not exists or is not an icon wizard');
        }

        $values = $dataContainer->activeRecord->$field;

        // Call the load_callback
        if (is_array($this->dca['fields'][$field]['load_callback'])) {
            foreach ($this->dca['fields'][$field]['load_callback'] as $callback) {
                $values = $this->triggerCallback($callback, array($values, $dataContainer));
            }
        }

        // support options callback
        if (isset($this->dca['fields'][$field]['options_callback'])) {
            $this->dca['fields'][$field]['options'] = $this->triggerCallback(
                $this->dca['fields'][$field]['options_callback'],
                array($dataContainer)
            );
        }

        return $dataContainer;
    }
268151
public function bindValue($parameter, $value, $data_type = PDO::PARAM_STR)
	{
		$this->bindValues[$parameter] = array($parameter, $value, $data_type);
	}
971518
public function setDateAdded(DataContainer $dc)
    {
        $modelUtil = $this->container->get('huh.utils.model');

        if (null === $dc || null === ($model = $modelUtil->findModelInstanceByPk($dc->table, $dc->id)) || $model->dateAdded > 0) {
            return null;
        }

        $this->framework->createInstance(Database::class)->prepare("UPDATE $dc->table SET dateAdded=? WHERE id=? AND dateAdded = 0")->execute(time(), $dc->id);
    }
89759
public function setCellValue(int $col, int $row, string $value, string $ajax_url = '')
    {
        if (!isset($this->structure[$row][$col])) {
            return $this;
        }

        // Show loader
        if (!$value && $ajax_url) {
            $value = '<img src="'. DIR_CMS_IMAGES_URL .'loading.gif">';
        }

        $this->structure[$row][$col]['value'] = $value;
        $this->structure[$row][$col]['ajax_url'] = $ajax_url;

        return $this;
    }
832833
public function set($name, $value) {
        $data = array();
        $dataPointer = &$data;
        $parents = explode('.', $name);
        $name = array_pop($parents);
        foreach ($parents as $parent) {
            $dataPointer[$parent] = array();
            $dataPointer = &$dataPointer[$parent];
        }
        $dataPointer[$name] = $value;
        $this->load($data);
    }
846957
public function panelGroupOptions($dataContainer = null): array
    {
        $columns[] = 'tl_content.type = ?';
        $values[]  = 'bs_panel_group_start';

        if ($dataContainer) {
            $columns[] = 'tl_content.pid = ?';
            $columns[] = 'tl_content.ptable = ?';
            $columns[] = 'tl_content.sorting < ?';

            $values[] = $dataContainer->activeRecord->pid;
            $values[] = $dataContainer->activeRecord->ptable;
            $values[] = $dataContainer->activeRecord->sorting;
        }

        $collection = $this->repository->findBy($columns, $values, ['order' => 'tl_content.sorting ASC']);
        $options    = [];

        if ($collection) {
            foreach ($collection as $model) {
                $options[$model->id] = sprintf(
                    '%s [%s]',
                    $model->bs_panel_name,
                    $model->id
                );
            }
        }

        return $options;
    }
1074800
public function editLocationStyle(DataContainer $dc)
   	{
   		return ($dc->value < 1) ? '' : ' <a href="contao/main.php?do=c4g_map_locstyles&amp;act=edit&amp;id=' . $dc->value . '&amp;popup=1&amp;nb=1&amp;rt=' . REQUEST_TOKEN . '" title="' . sprintf(specialchars($GLOBALS['TL_LANG']['tl_c4g_maps']['editalias'][1]), $dc->value) . '" style="padding-left:3px" onclick="Backend.openModalIframe({\'width\':768,\'title\':\'' . specialchars(str_replace("'", "\\'", sprintf($GLOBALS['TL_LANG']['tl_c4g_maps']['editalias'][1], $dc->value))) . '\',\'url\':this.href});return false">' . Image::getHtml('alias.gif', $GLOBALS['TL_LANG']['tl_c4g_maps']['editalias'][0], 'style="vertical-align:top"') . '</a>';
   	}
397262
public function column($name, $value = null)
    {
        if (is_null($value)) {
            $column = array_get($this->data, $name);

            return $this->dump($column);
        }

        if ($value instanceof \Closure) {
            $value = $value->call($this, $this->column($name));
        }

        array_set($this->data, $name, $value);

        return $this;
    }
1186347
public function setColumn(string $column, $value)
    {
        $this->table->getColumn($column);

        $this->columnData[$column] = $value;
    }
43938
public function executePostActions(DataContainerInterface $container)
    {
        \header('Content-Type: text/html; charset=' . $GLOBALS['TL_CONFIG']['characterSet']);

        $this->objDc = $container;

        $action = $this->getEnvironment()->getInputProvider()->getValue('action');

        if (\in_array(
            $action,
            [
                // This is impossible to handle generically in DcGeneral.
                'toggleFeatured',
                // DcGeneral handles sub palettes differently.
                'toggleSubpalette'
            ]
        )) {
            return;
        }

        if (\in_array(
            $action,
            [
                // Load nodes of the page structure tree. Compatible between 2.X and 3.X.
                'loadStructure',
                // Load nodes of the file manager tree.
                'loadFileManager',
                // Load nodes of the page tree.
                'loadPagetree',
                // Load nodes of the file tree.
                'loadFiletree',
                // Reload the page/file picker.
                'reloadPagetree',
                'reloadFiletree',
                'setLegendState'
            ]
        )) {
            $this->{$action}();
            return;
        }

        $ajax = new ContaoAjax($action);
        $ajax->executePreActions();
        $ajax->executePostActions(new DcCompat($this->getEnvironment(), $this->getActiveModel()));
    }
854119
public function readData(DataContainer $data)
    {
        $this->type = $data->getString('t', '');
        $this->name = $data->getString('n', '');
        $this->labels->readData($data->getObject('l'));
        $this->descriptions->readData($data->getObject('d'));
        $this->providesRecipeLocalisation = $data->getInteger('r', 0) === 1;
        $this->providesMachineLocalisation = $data->getInteger('m', 0) === 1;
        $this->iconHash = $data->getString('i');
        $this->isNew = $data->getInteger('e', 1) === 1;
        return $this;
    }
234697
public function setValue($value, $data = null)
    {
        if ($data instanceof DataObject) {
            $this->loadFrom($data);
            return $this;
        }
        
        return parent::setValue($value);
    }
792722
public function prepareValue($value, $datatype)
     {
        if ($value === null) {
            return 'NULL';
        }
        switch ($datatype) {
            case Column::TYPE_INTEGER:
                // Filter explicitly because some DBAL silently convert/truncate to integer
                $filtered = filter_var($value, FILTER_VALIDATE_INT);
                if ($filtered === false) {
                    throw new \InvalidArgumentException('Not an integer: '. $value);
                }
                return $filtered; // No quotes necessary
            case Column::TYPE_FLOAT:
            case Column::TYPE_DECIMAL:
                // Filter explicitly because some DBAL silently convert/truncate to float
                $filtered = filter_var($value, FILTER_VALIDATE_FLOAT);
                if ($filtered === false) {
                    throw new \InvalidArgumentException('Not a number: '. $value);
                }
                return $filtered; // No quotes necessary
            case Column::TYPE_BOOL:
                if (is_bool($value)) { // filter_var() does not work with real booleans
                    $filtered = $value;
                } else {
                    $filtered = filter_var($value, FILTER_VALIDATE_BOOLEAN, FILTER_NULL_ON_FAILURE);
                }
                if ($filtered === null) {
                    throw new \InvalidArgumentException('Not a boolean: ' . $value);
                }
                return (integer)$filtered; // Convert to 0/1 for compatibility with emulated booleans
            case Column::TYPE_BLOB:
                // Handled differently across DBMS and abstraction layers - refuse by default.
                throw new \InvalidArgumentException('Cannot prepare BLOB values');
            default:
                return $this->_link->quoteValue($value, $datatype);
        }
     }
1338860
public function setValue($value, $data = null)
    {
        $value = $this->preventHtmlParserError($value);
        return parent::setValue($value, $data);
    }
984317
protected function setCol($col, $value)
    {
        if ($value === null) {
            $value = 'NULL';
        }

        $key                    = $this->quoteName($col);
        $value                  = $this->quoteNamesIn($value);
        $this->col_values[$key] = $value;
        return $this;
    }
250973
public function setDataValue($columnName, $value)
    {
        switch ($columnName) {
            case 'kod':
                $value = self::uncode($value); //Alwyas uncode "kod" column
                break;
            default:
                if (is_object($value)) {
                    switch (get_class($value)) {
                        case 'DateTime':
                            $columnInfo = $this->getColumnInfo($columnName);
                            switch ($columnInfo['type']) {
                                case 'date':
                                    $value = self::dateToFlexiDate($value);
                                    break;
                                case 'datetime':
                                    $value = self::dateToFlexiDateTime($value);
                                    break;
                            }
                            break;
                    }
                }
                $result = parent::setDataValue($columnName, $value);
                break;
        }
        return $result;
    }