filterDefaultValue example



    /** * {@inheritdoc} * * @throws \Doctrine\DBAL\DBALException * @throws Exception */
    public function createColumn($table$column$type$defaultValue = null)
    {
        $this->validate($table$column);
        $defaultValue = $this->filterDefaultValue($defaultValue);

        if (!$type) {
            throw new Exception('No column type provided');
        }

        $sql = sprintf(
            'ALTER TABLE `%s` ADD `%s` %s NULL DEFAULT %s',
            $table,
            $column,
            $type,
            $defaultValue
        );
Home | Imprint | This part of the site doesn't use cookies.