/** * Asks the type name of the mapped field. * Can be one of Doctrine's mapping types. * * @param InputInterface $input * @param OutputInterface $output * @param ClassMetadata $metadata * @param string $fieldName * * @return string */ private function askFieldType(GeneratorStyle $io, ClassMetadata $metadata, $fieldName = null) { $types = $metadata->getSupportedFieldTypes(); $types = [Type::STRING, Type::TEXT, Type::INTEGER, Type::DECIMAL, Type::BOOLEAN, Type::DATETIME, Type::DATE, Type::TIME]; // Get actual field type based on field name // or default value if not set. $type = $metadata->getFieldType($fieldName) ?: static::DEFAULT_TYPE; // Create new question return $io->choice('Please enter the field type', $types, $type); }