/** * Asks the name of the field that completes the bidirectional association on the inverse side. * The key 'inversedBy' must be specified on the owning side of a bidirectional association. * * @param InputInterface $input * @param OutputInterface $output * @param ClassMetadata $metadata * @param string $associationName * * @return string */ private function askAssociationInversedBy(GeneratorStyle $io, ClassMetadata $metadata, $associationName = null) { // Get actual field inversedBy based on field name // or default value if not set. $inversedBy = $metadata->getAssociationInversedBy($associationName) ?: static::DEFAULT_INVERSED_BY; // Create new question return $io->ask('Inversed by', $inversedBy, function ($answer) { // return $answer; }); }