@param string $column
@param string $enumName
@param string $locale

@return \Illuminate\Contracts\Translation\Translator|string
766355
public function enum($column, $enumName = null, $locale = null)
    {
        return $this->__($column, $enumName, $locale);
    }
505079
public function localizedSystemName($name, $locale)
    {
        if (null === $locale) {
            throw new InvalidLocaleException($locale);
        }

        return $this->formatLocalizedName('system_localized', $name, $locale);
    }
1343
protected function createAttributeValueTranslation($name, $locale)
    {
        $translation = new AttributeValueTranslation();
        $translation->setName($name);
        $translation->setLocale($locale);

        return $translation;
    }
616665
public function getLocalisedTable($tableName, $locale = '')
    {
        $localisedTable = $tableName . '_' . self::SUFFIX;
        if ($locale) {
            $localisedTable .= '_' . $locale;
        }
        return $localisedTable;
    }
516713
public function getEnumValues(string $table, string $column): array {
		$query = <<<QUERY
			SELECT COLUMN_TYPE
			FROM INFORMATION_SCHEMA.COLUMNS
			WHERE TABLE_SCHEMA = :database
			AND TABLE_NAME = :table
			AND COLUMN_NAME = :column
			AND DATA_TYPE IN ('enum','set')
QUERY;
		
		$params = [
			"database" => $this->database,
			"table"    => $table,
			"column"   => $column,
		];
		
		try {
			$type = $this->getVar($query, $params);
		} catch (DatabaseException $databaseException) {
			throw $this->prepareMysqlException($databaseException, $query, $params);
		}
		
		// now we want to (a) confirm that this is an enum (or set) field, and
		// if so (b) extract the set of possible values that it represents.
		// string manipulation to the rescue!
		
		if (strpos($type, "enum(") === 0 || strpos($type, "set(") === 0) {
			
			// the type information is in the form of enum('a','b','c',...,'z').
			// we can match that information with a regular expression as follows.
			
			preg_match_all("/'([^']+)'/", $type, $matches);
			$values = $matches[1];
		} else {
			throw new MysqlException("getEnumValues failed: type mismatch");
		}
		
		return $values;
	}
709508
protected function typeEnum(Fluent $column)
    {
        $allowed = array_map(function ($a) {
            return "'{$a}'";
        }, $column->allowed);

        return "varchar(255) check (\"{$column->name}\" in (" . implode(', ', $allowed) . '))';
    }
970379
public function translate($entity, $locale)
    {
        $metadata = $this->metadataCollection->getMetadata($entity);
        if($metadata === null) {
            return null;
        }

        //translation data is stored inside the object
        if($locale === $this->defaultLocale) {
            return;
        }

        $accessor = PropertyAccess::createPropertyAccessor();   
        if($metadata !== null) {
            foreach($metadata->getProperties() as $property) {
                $strategy = $this->strategyResolver->getStrategy($property->getStrategy());
                $value = $strategy->getTranslation($entity, $property, $locale, $metadata);
                $accessor->setValue($entity, $property->getName(), $value);
            }
        }
    }
1335752
public function findByName( $name, $locale = null )
    {
        $locale = $locale ?: $this->getLocale();
        $lang   = Locale::getPrimaryLanguage( $locale );

        return $this->findOne( array(
            'name' => $name,
        ), array(
            new Expression(
                'CASE ? ' .
                    'WHEN ? THEN 1 ' .
                    'WHEN ? THEN 2 ' .
                    'WHEN ? THEN 3 ' .
                    'ELSE 4 ' .
                'END ASC',
                array(
                    'locale',
                    $locale,
                    $lang,
                    static::FALLBACK_LOCALE
                ),
                array(
                    Expression::TYPE_IDENTIFIER,
                    Expression::TYPE_VALUE,
                    Expression::TYPE_VALUE,
                    Expression::TYPE_VALUE,
                )
            ),
        ) );
    }
571451
protected function translateColumn($column) {
		if ($column instanceof Column)
			return $column->getName();
		
		return preg_match('/^(\w+)/', $column, $matches) ? $matches[1] : $column;
	}
465852
protected function addTranslatedColumnGetter(Column $column)
    {
        $objectBuilder = $this->builder->getNewObjectBuilder($this->behavior->getI18nTable());
        $comment = '';
        $functionStatement = '';
        if ($this->isDateType($column->getType())) {
            $objectBuilder->addTemporalAccessorComment($comment, $column);
            $objectBuilder->addTemporalAccessorOpen($functionStatement, $column);
        } else {
            $objectBuilder->addDefaultAccessorComment($comment, $column);
            $objectBuilder->addDefaultAccessorOpen($functionStatement, $column);
        }
        $comment = preg_replace('/^\t/m', '', $comment);
        $functionStatement = preg_replace('/^\t/m', '', $functionStatement);
        preg_match_all('/\$[a-z]+/i', $functionStatement, $params);

        return $this->behavior->renderTemplate('objectTranslatedColumnGetter', [
            'comment'           => $comment,
            'functionStatement' => $functionStatement,
            'columnPhpName'     => $column->getPhpName(),
            'params'            => implode(', ', $params[0]),
        ]);
    }
225788
public function addEnumValue ($table, $column, $value, $default = false)
		{
			echo "    > add enum value $value to column $column in $table ...\n";
			$time = microtime(true);

			$columnSchema = $this->db->getTableSchema($table)->columns[ $column ];
			$values = $columnSchema->enumValues;
			$values[] = $value;
			$defaultValue = $default ? $value : $columnSchema->defaultValue;
			$this->alterColumn($table, $column, $this->enum($values)->defaultValue($defaultValue));

			echo '    > done (time: ' . sprintf('%.3f', microtime(true) - $time) . "s)\n";
		}
831232
public function locale($code, $locale = null)
    {
        $name = Intl::getLocaleBundle()->getLocaleName($code, $locale ?: $this->localeDetector->getLocale());

        return $name ? $this->fixCharset($name) : '';
    }
1288886
protected function addEnumAccessorBody(&$script, Column $col)
    {
        $cfc = $col->getPhpName();
        $clo = strtolower($col->getName());
        if ($col->isLazyLoad()) {
            $script .= $this->getAccessorLazyLoadSnippet($col);
        }

        $script .= "
        if (null === \$this->$clo) {
            return null;
        }
        \$valueSet = " . $this->getPeerClassname() . "::getValueSet(" . $this->getColumnConstant($col) . ");
        if (!isset(\$valueSet[\$this->$clo])) {
            throw new PropelException('Unknown stored enum key: ' . \$this->$clo);
        }

        return \$valueSet[\$this->$clo];";
    }
333680
public function getEnumValues($tableName, $columnName) {

		// check whether column exists

		if(!$this->columnExists($tableName, $columnName)) {
			throw new \PDOException(sprintf("Unknown column '%s' in table '%s'.", $columnName, $tableName));
		}
		
		// wrong data type
		
		$dataType = $this->tableStructureCache[$tableName][$columnName]['dataType']; 
		
		if(!($dataType === 'enum' || $dataType === 'set')) {
			throw new \PDOException(sprintf("Column '%s' in table '%s' is not of type ENUM or SET.", $columnName, $tableName));
		}
		
		// extract enum values the first time

		if(!isset($this->tableStructureCache[$tableName][$columnName]['enumValues'])) {
			preg_match_all(
				"~'(.*?)'~i",
				$this->tableStructureCache[$tableName][$columnName]['columnType'],
				$matches
			);
			
			$this->tableStructureCache[$tableName][$columnName]['enumValues'] = $matches[1];
		}
		
		return $this->tableStructureCache[$tableName][$columnName]['enumValues'];
		
	}
865868
public function asEnum($value, $enumName)
    {
        if (!isset($this->enums[$enumName])) {
            throw new InvalidParamException("The '$enumName' enum has not been registered in the current formatter");
        }
        if ($value === null) {
            return $this->nullDisplay;
        }
        return isset($this->enums[$enumName][$value]) ? $this->enums[$enumName][$value] : $value;
    }
950413
public function getColumnName($column, $model = null): string
    {
        $model = $model ?? $this->model;

        return !strpos($column, '.')
            ? $this->getTableName($model) . '.' . $column
            : $column;
    }
870310
protected function _DefineColumn($Column) {
      if (!is_array($Column->Type) && !in_array($Column->Type, array('tinyint', 'smallint', 'mediumint', 'int', 'bigint', 'char', 'varchar', 'varbinary', 'date', 'datetime', 'mediumtext', 'longtext', 'text', 'decimal', 'numeric', 'float', 'double', 'enum', 'timestamp', 'tinyblob', 'blob', 'mediumblob', 'longblob')))
         throw new Exception(sprintf(T('The specified data type (%1$s) is not accepted for the MySQL database.'), $Column->Type));
      
      $Return = '`'.$Column->Name.'` '.$Column->Type;
      
      $LengthTypes = $this->Types('length');
      if ($Column->Length != '' && in_array(strtolower($Column->Type), $LengthTypes)) {
         if($Column->Precision != '')
            $Return .= '('.$Column->Length.', '.$Column->Precision.')';
         else
            $Return .= '('.$Column->Length.')';
      }
      if (property_exists($Column, 'Unsigned') && $Column->Unsigned) {
         $Return .= ' unsigned';
      }

      if (is_array($Column->Enum))
         $Return .= "('".implode("','", $Column->Enum)."')";

      if (!$Column->AllowNull)
         $Return .= ' not null';

      if (!(is_null($Column->Default) || $Column->Default === '') && strcasecmp($Column->Type, 'timestamp') != 0)
         $Return .= " default ".self::_QuoteValue($Column->Default);

      if ($Column->AutoIncrement)
         $Return .= ' auto_increment';

      return $Return;
   }