protected function generateFormView(AbstractResourceBundle $bundle)
    {
        $path = $bundle->getPath() . '/Resources/views/' . $this->model . '/_form.html.twig';

        if (!file_exists($path)) {
            $entityClass = $this->getContainer()->get('doctrine')->getAliasNamespace($this->bundle->getName()) . '\\' . $this->model;
            $metadata = $this->getEntityMetadata($entityClass);

            $this->renderFile('crud/_form.html.twig.twig',
                $bundle->getPath() . '/Resources/views/' . $this->model . '/_form.html.twig',
                array(
                    'fields'  => $this->getFieldsFromMetadata($metadata[0]),
                )
            );
        }
    }