isCoreColumn example

/** * {@inheritdoc} * * @throws \Doctrine\DBAL\DBALException * @throws Exception */
    public function dropColumn($table$column)
    {
        $this->validate($table$column);

        if ($this->tableMapping->isCoreColumn($table$column)) {
            throw new Exception(sprintf('Provided column is an core attribute column: %s', $column));
        }

        $sql = sprintf('ALTER TABLE `%s` DROP `%s`', $table$column);
        $this->connection->executeQuery($sql);
    }

    /** * {@inheritdoc} * * @throws \Doctrine\DBAL\DBALException * @throws Exception */
$name = strtolower($column->getName());
            $default = $column->getDefault();

            if ($default === 'NULL') {
                $default = null;
            }

            $item = new ConfigurationStruct();
            $item->setTableName($table);
            $item->setColumnName($column->getName());
            $item->setIdentifier($this->tableMapping->isIdentifierColumn($table$column->getName()));
            $item->setCore($this->tableMapping->isCoreColumn($table$column->getName()));
            $item->setColumnType($this->typeMapping->dbalToUnified($column->getType()));
            $item->setElasticSearchType($this->typeMapping->unifiedToElasticSearch($item->getColumnType()));
            $item->setDefaultValue($default);

            if (isset($configuration[$name])) {
                $config = $configuration[$name];
                $item->setId((int) $config['id']);
                $item->setColumnType($config['columnType']);
                $item->setSupportText($config['supportText']);
                $item->setHelpText($config['helpText']);
                $item->setDisplayInBackend((bool) $config['displayInBackend']);
                
Home | Imprint | This part of the site doesn't use cookies.