RainLab\Builder\Classes\TableMigrationCodeGenerator::generateDefaultMethodCall PHP Method

generateDefaultMethodCall() protected method

protected generateDefaultMethodCall ( $default, $column )
    protected function generateDefaultMethodCall($default, $column)
    {
        $columnName = $column->getName();
        $typeName = $column->getType()->getName();
        $type = MigrationColumnType::toMigrationMethodName($typeName, $columnName);
        if (in_array($type, MigrationColumnType::getIntegerTypes()) || in_array($type, MigrationColumnType::getDecimalTypes()) || $type == MigrationColumnType::TYPE_BOOLEAN) {
            return sprintf('->default(%s)', $default);
        }
        return sprintf('->default(\'%s\')', $this->quoteParameter($default));
    }