MOON
Server: Apache
System: Linux res.emeff.ca 3.10.0-962.3.2.lve1.5.24.10.el7.x86_64 #1 SMP Wed Mar 20 07:36:02 EDT 2019 x86_64
User: accemeff (1004)
PHP: 7.0.33
Disabled: NONE
Upload Files
File: /home/accemeff/vendor/craftcms/cms/src/db/mysql/ColumnSchemaBuilder.php
<?php
/**
 * @link https://craftcms.com/
 * @copyright Copyright (c) Pixel & Tonic, Inc.
 * @license https://craftcms.github.io/license/
 */

namespace craft\db\mysql;

use Craft;
use yii\db\mysql\ColumnSchemaBuilder as YiiColumnSchemaBuilder;

/**
 * @inheritdoc
 * @author Pixel & Tonic, Inc. <support@pixelandtonic.com>
 * @since 3.0
 */
class ColumnSchemaBuilder extends YiiColumnSchemaBuilder
{
    /**
     * @inheritdoc
     */
    public function init()
    {
        $this->categoryMap[Schema::TYPE_TINYTEXT] = self::CATEGORY_STRING;
        $this->categoryMap[Schema::TYPE_MEDIUMTEXT] = self::CATEGORY_STRING;
        $this->categoryMap[Schema::TYPE_LONGTEXT] = self::CATEGORY_STRING;
        $this->categoryMap[Schema::TYPE_ENUM] = self::CATEGORY_STRING;
    }

    /**
     * @inheritdoc
     */
    protected function buildLengthString()
    {
        if ($this->type == Schema::TYPE_ENUM) {
            $schema = Craft::$app->getDb()->getSchema();
            $str = '(';
            foreach ($this->length as $i => $value) {
                if ($i != 0) {
                    $str .= ',';
                }
                $str .= $schema->quoteValue($value);
            }
            $str .= ')';

            return $str;
        }

        return parent::buildLengthString();
    }
}