/**
     * Asks the metadata informations to the user.
     *
     * @param InputInterface  $input
     * @param OutputInterface $output
     */
    public function interact(InputInterface $input, OutputInterface $output)
    {
        $io = new GeneratorStyle($input, $output);
        $io->block('Doctrine2 Entity Edition');
        $io->caution(['Caution is needed with this command, code can be lost.', 'This command will regenerate an entity based on its metadata.
It means all custom code not generated by this tool will be lost.']);
        $io->title('Entity definition');
        // Get metadata helper
        /* @var Remg\Bundle\GeneratorBundle\Console\Helper\MetadataHelper */
        $helper = $this->getContainer()->get('remg_metadata_helper');
        // Ask entity class name (shortcut notation)
        $shortcut = $helper->askShortcut($io, $input->getOption('entity'));
        // Check if metadata already exists for specified entity
        if (!($metadata = $helper->getManager()->find($shortcut))) {
            throw new \InvalidArgumentException(sprintf('Entity "%s" does not exist.', $shortcut));
        }
        $helper->displaySummary($io, $metadata);
        // Ask entity metadata informations
        $helper->askMetadata($io, $metadata);
        // Store metadata informations in input
        $input->setOption('entity', $metadata);
    }
 /**
  * Asks the metadata informations to the user.
  *
  * @param InputInterface  $input
  * @param OutputInterface $output
  */
 public function interact(InputInterface $input, OutputInterface $output)
 {
     $io = new GeneratorStyle($input, $output);
     $io->block('Doctrine2 Entity Edition');
     $io->title('Entity definition');
     // Get metadata helper
     /* @var Remg\Bundle\GeneratorBundle\Console\Helper\MetadataHelper */
     $helper = $this->getContainer()->get('remg_metadata_helper');
     // Ask entity class name (shortcut notation)
     $shortcut = $helper->askShortcut($io, $input->getOption('entity'));
     // Check if metadata already exists for specified entity
     if ($entity = $helper->getManager()->find($shortcut)) {
         throw new \InvalidArgumentException(sprintf('Entity "%s" already exists.', $entity->getName()));
     }
     // Create new metadata informations
     /* @var Remg\Bundle\GeneratorBundle\Mapping\ClassMetadata */
     $metadata = $helper->getManager()->create($shortcut);
     // Ask entity metadata informations
     $helper->askMetadata($io, $metadata);
     // Store metadata informations in input
     $input->setOption('entity', $metadata);
 }