Skip to content
This repository
Browse code

[DoctrineBundle] removed the bundle (migrated to the Doctrine organiz…

…ation)
  • Loading branch information...
commit dcf209a4aaf27147848437bc5a505b5506116d44 1 parent d3ab39d
Fabien Potencier fabpot authored

Showing 82 changed files with 0 additions and 5,086 deletions. Show diff stats Hide diff stats

  1. +0 68 src/Symfony/Bundle/DoctrineBundle/Command/CreateDatabaseDoctrineCommand.php
  2. +0 52 src/Symfony/Bundle/DoctrineBundle/Command/DoctrineCommand.php
  3. +0 80 src/Symfony/Bundle/DoctrineBundle/Command/DropDatabaseDoctrineCommand.php
  4. +0 131 src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php
  5. +0 123 src/Symfony/Bundle/DoctrineBundle/Command/ImportMappingDoctrineCommand.php
  6. +0 86 src/Symfony/Bundle/DoctrineBundle/Command/InfoDoctrineCommand.php
  7. +0 55 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/ClearMetadataCacheDoctrineCommand.php
  8. +0 55 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/ClearQueryCacheDoctrineCommand.php
  9. +0 70 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/ClearResultCacheDoctrineCommand.php
  10. +0 65 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/ConvertMappingDoctrineCommand.php
  11. +0 60 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/CreateSchemaDoctrineCommand.php
  12. +0 46 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/DoctrineCommandHelper.php
  13. +0 60 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/DropSchemaDoctrineCommand.php
  14. +0 55 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/EnsureProductionSettingsDoctrineCommand.php
  15. +0 60 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/RunDqlDoctrineCommand.php
  16. +0 50 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/RunSqlDoctrineCommand.php
  17. +0 64 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/UpdateSchemaDoctrineCommand.php
  18. +0 56 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/ValidateSchemaCommand.php
  19. +0 75 src/Symfony/Bundle/DoctrineBundle/ConnectionFactory.php
  20. +0 105 src/Symfony/Bundle/DoctrineBundle/DependencyInjection/Compiler/RegisterEventListenersAndSubscribersPass.php
  21. +0 289 src/Symfony/Bundle/DoctrineBundle/DependencyInjection/Configuration.php
  22. +0 430 src/Symfony/Bundle/DoctrineBundle/DependencyInjection/DoctrineExtension.php
  23. +0 92 src/Symfony/Bundle/DoctrineBundle/DoctrineBundle.php
  24. +0 52 src/Symfony/Bundle/DoctrineBundle/Mapping/ClassMetadataCollection.php
  25. +0 23 src/Symfony/Bundle/DoctrineBundle/Mapping/DisconnectedMetadataFactory.php
  26. +0 174 src/Symfony/Bundle/DoctrineBundle/Mapping/MetadataFactory.php
  27. +0 152 src/Symfony/Bundle/DoctrineBundle/Registry.php
  28. +0 64 src/Symfony/Bundle/DoctrineBundle/Resources/config/dbal.xml
  29. +0 81 src/Symfony/Bundle/DoctrineBundle/Resources/config/orm.xml
  30. +0 149 src/Symfony/Bundle/DoctrineBundle/Resources/config/schema/doctrine-1.0.xsd
  31. +0 88 src/Symfony/Bundle/DoctrineBundle/Resources/views/Collector/db.html.twig
  32. +0 45 src/Symfony/Bundle/DoctrineBundle/Tests/Command/InfoDoctrineCommandTest.php
  33. +0 48 src/Symfony/Bundle/DoctrineBundle/Tests/ContainerTest.php
  34. +0 788 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/AbstractDoctrineExtensionTest.php
  35. +0 18 ...ny/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/AnnotationsBundle.php
  36. +0 16 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/AnnotationsBundle/Entity/Test.php
  37. +0 18 ...le/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/AnnotationsBundle.php
  38. +0 16 ...y/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/Vendor/AnnotationsBundle/Entity/Test.php
  39. +0 16 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Entity/Test.php
  40. 0  .../DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/Resources/config/doctrine/Test.orm.xml
  41. +0 18 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/XmlBundle/XmlBundle.php
  42. +0 17 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/Entity/Test.php
  43. +0 5 ...DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/Resources/config/doctrine/Test.orm.yml
  44. +0 18 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/Bundles/YamlBundle/YamlBundle.php
  45. +0 29 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_logging.xml
  46. +0 33 ...y/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_service_multiple_connections.xml
  47. +0 12 ...fony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_service_single_connection.xml
  48. +0 15 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/dbal_types.xml
  49. +0 25 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_functions.xml
  50. +0 21 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_hydration_mode.xml
  51. +0 16 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_imports.xml
  52. +0 23 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_imports_import.xml
  53. +0 27 ...ony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_multiple_em_bundle_mappings.xml
  54. +0 40 ...undle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_service_multiple_entity_managers.xml
  55. +0 26 ...e/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_service_simple_single_entity_manager.xml
  56. +0 39 ...y/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_service_single_entity_manager.xml
  57. +0 23 ...mfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_single_em_bundle_mappings.xml
  58. +0 20 ...Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/xml/orm_single_em_dql_functions.xml
  59. +0 13 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_logging.yml
  60. +0 18 ...y/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_service_multiple_connections.yml
  61. +0 6 ...fony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_service_single_connection.yml
  62. +0 7 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/dbal_types.yml
  63. +0 19 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_functions.yml
  64. +0 14 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_hydration_mode.yml
  65. +0 6 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_imports.yml
  66. +0 15 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_imports_import.yml
  67. +0 23 ...ony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_multiple_em_bundle_mappings.yml
  68. +0 34 ...undle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_service_multiple_entity_managers.yml
  69. +0 19 ...e/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_service_simple_single_entity_manager.yml
  70. +0 26 ...y/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_service_single_entity_manager.yml
  71. +0 18 ...mfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_single_em_bundle_mappings.yml
  72. +0 11 ...Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/Fixtures/config/yml/orm_single_em_dql_functions.yml
  73. +0 29 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/TestDatetimeFunction.php
  74. +0 29 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/TestNumericFunction.php
  75. +0 29 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/TestStringFunction.php
  76. +0 27 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/TestType.php
  77. +0 63 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/XMLSchemaTest.php
  78. +0 25 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/XmlDoctrineExtensionTest.php
  79. +0 25 src/Symfony/Bundle/DoctrineBundle/Tests/DependencyInjection/YamlDoctrineExtensionTest.php
  80. +0 146 src/Symfony/Bundle/DoctrineBundle/Tests/RegistryTest.php
  81. +0 75 src/Symfony/Bundle/DoctrineBundle/Tests/TestCase.php
  82. +0 27 src/Symfony/Bundle/DoctrineBundle/composer.json
68 src/Symfony/Bundle/DoctrineBundle/Command/CreateDatabaseDoctrineCommand.php
... ... @@ -1,68 +0,0 @@
1   -<?php
2   -
3   -/*
4   - * This file is part of the Symfony package.
5   - *
6   - * (c) Fabien Potencier <fabien@symfony.com>
7   - *
8   - * For the full copyright and license information, please view the LICENSE
9   - * file that was distributed with this source code.
10   - */
11   -
12   -namespace Symfony\Bundle\DoctrineBundle\Command;
13   -
14   -use Symfony\Component\Console\Input\InputOption;
15   -use Symfony\Component\Console\Input\InputInterface;
16   -use Symfony\Component\Console\Output\OutputInterface;
17   -use Doctrine\DBAL\DriverManager;
18   -
19   -/**
20   - * Database tool allows you to easily drop and create your configured databases.
21   - *
22   - * @author Fabien Potencier <fabien@symfony.com>
23   - * @author Jonathan H. Wage <jonwage@gmail.com>
24   - */
25   -class CreateDatabaseDoctrineCommand extends DoctrineCommand
26   -{
27   - protected function configure()
28   - {
29   - $this
30   - ->setName('doctrine:database:create')
31   - ->setDescription('Create the configured databases')
32   - ->addOption('connection', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command')
33   - ->setHelp(<<<EOT
34   -The <info>doctrine:database:create</info> command creates the default
35   -connections database:
36   -
37   -<info>php app/console doctrine:database:create</info>
38   -
39   -You can also optionally specify the name of a connection to create the
40   -database for:
41   -
42   -<info>php app/console doctrine:database:create --connection=default</info>
43   -EOT
44   - );
45   - }
46   -
47   - protected function execute(InputInterface $input, OutputInterface $output)
48   - {
49   - $connection = $this->getDoctrineConnection($input->getOption('connection'));
50   -
51   - $params = $connection->getParams();
52   - $name = isset($params['path']) ? $params['path'] : $params['dbname'];
53   -
54   - unset($params['dbname']);
55   -
56   - $tmpConnection = DriverManager::getConnection($params);
57   -
58   - try {
59   - $tmpConnection->getSchemaManager()->createDatabase($name);
60   - $output->writeln(sprintf('<info>Created database for connection named <comment>%s</comment></info>', $name));
61   - } catch (\Exception $e) {
62   - $output->writeln(sprintf('<error>Could not create database for connection named <comment>%s</comment></error>', $name));
63   - $output->writeln(sprintf('<error>%s</error>', $e->getMessage()));
64   - }
65   -
66   - $tmpConnection->close();
67   - }
68   -}
52 src/Symfony/Bundle/DoctrineBundle/Command/DoctrineCommand.php
... ... @@ -1,52 +0,0 @@
1   -<?php
2   -
3   -/*
4   - * This file is part of the Symfony package.
5   - *
6   - * (c) Fabien Potencier <fabien@symfony.com>
7   - *
8   - * For the full copyright and license information, please view the LICENSE
9   - * file that was distributed with this source code.
10   - */
11   -
12   -namespace Symfony\Bundle\DoctrineBundle\Command;
13   -
14   -use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand;
15   -use Doctrine\ORM\Tools\EntityGenerator;
16   -
17   -/**
18   - * Base class for Doctrine console commands to extend from.
19   - *
20   - * @author Fabien Potencier <fabien@symfony.com>
21   - */
22   -abstract class DoctrineCommand extends ContainerAwareCommand
23   -{
24   - protected function getEntityGenerator()
25   - {
26   - $entityGenerator = new EntityGenerator();
27   - $entityGenerator->setGenerateAnnotations(false);
28   - $entityGenerator->setGenerateStubMethods(true);
29   - $entityGenerator->setRegenerateEntityIfExists(false);
30   - $entityGenerator->setUpdateEntityIfExists(true);
31   - $entityGenerator->setNumSpaces(4);
32   - $entityGenerator->setAnnotationPrefix('ORM\\');
33   -
34   - return $entityGenerator;
35   - }
36   -
37   - protected function getEntityManager($name)
38   - {
39   - return $this->getContainer()->get('doctrine')->getManager($name);
40   - }
41   -
42   - /**
43   - * Get a doctrine dbal connection by symfony name.
44   - *
45   - * @param string $name
46   - * @return Doctrine\DBAL\Connection
47   - */
48   - protected function getDoctrineConnection($name)
49   - {
50   - return $this->getContainer()->get('doctrine')->getConnection($name);
51   - }
52   -}
80 src/Symfony/Bundle/DoctrineBundle/Command/DropDatabaseDoctrineCommand.php
... ... @@ -1,80 +0,0 @@
1   -<?php
2   -
3   -/*
4   - * This file is part of the Symfony package.
5   - *
6   - * (c) Fabien Potencier <fabien@symfony.com>
7   - *
8   - * For the full copyright and license information, please view the LICENSE
9   - * file that was distributed with this source code.
10   - */
11   -
12   -namespace Symfony\Bundle\DoctrineBundle\Command;
13   -
14   -use Symfony\Component\Console\Input\InputOption;
15   -use Symfony\Component\Console\Input\InputInterface;
16   -use Symfony\Component\Console\Output\OutputInterface;
17   -
18   -/**
19   - * Database tool allows you to easily drop and create your configured databases.
20   - *
21   - * @author Fabien Potencier <fabien@symfony.com>
22   - * @author Jonathan H. Wage <jonwage@gmail.com>
23   - */
24   -class DropDatabaseDoctrineCommand extends DoctrineCommand
25   -{
26   - protected function configure()
27   - {
28   - $this
29   - ->setName('doctrine:database:drop')
30   - ->setDescription('Drop the configured databases')
31   - ->addOption('connection', null, InputOption::VALUE_OPTIONAL, 'The connection to use for this command')
32   - ->addOption('force', null, InputOption::VALUE_NONE, 'Set this parameter to execute this action')
33   - ->setHelp(<<<EOT
34   -The <info>doctrine:database:drop</info> command drops the default connections
35   -database:
36   -
37   -<info>php app/console doctrine:database:drop</info>
38   -
39   -The --force parameter has to be used to actually drop the database.
40   -
41   -You can also optionally specify the name of a connection to drop the database
42   -for:
43   -
44   -<info>php app/console doctrine:database:drop --connection=default</info>
45   -
46   -<error>Be careful: All data in a given database will be lost when executing
47   -this command.</error>
48   -EOT
49   - );
50   - }
51   -
52   - protected function execute(InputInterface $input, OutputInterface $output)
53   - {
54   - $connection = $this->getDoctrineConnection($input->getOption('connection'));
55   -
56   - $params = $connection->getParams();
57   -
58   - $name = isset($params['path']) ? $params['path'] : (isset($params['dbname']) ? $params['dbname'] : false);
59   -
60   - if (!$name) {
61   - throw new \InvalidArgumentException("Connection does not contain a 'path' or 'dbname' parameter and cannot be dropped.");
62   - }
63   -
64   - if ($input->getOption('force')) {
65   - try {
66   - $connection->getSchemaManager()->dropDatabase($name);
67   - $output->writeln(sprintf('<info>Dropped database for connection named <comment>%s</comment></info>', $name));
68   - } catch (\Exception $e) {
69   - $output->writeln(sprintf('<error>Could not drop database for connection named <comment>%s</comment></error>', $name));
70   - $output->writeln(sprintf('<error>%s</error>', $e->getMessage()));
71   - }
72   - } else {
73   - $output->writeln('<error>ATTENTION:</error> This operation should not be executed in a production environment.');
74   - $output->writeln('');
75   - $output->writeln(sprintf('<info>Would drop the database named <comment>%s</comment>.</info>', $name));
76   - $output->writeln('Please run the operation with --force to execute');
77   - $output->writeln('<error>All data will be lost!</error>');
78   - }
79   - }
80   -}
131 src/Symfony/Bundle/DoctrineBundle/Command/GenerateEntitiesDoctrineCommand.php
... ... @@ -1,131 +0,0 @@
1   -<?php
2   -
3   -/*
4   - * This file is part of the Symfony package.
5   - *
6   - * (c) Fabien Potencier <fabien@symfony.com>
7   - *
8   - * For the full copyright and license information, please view the LICENSE
9   - * file that was distributed with this source code.
10   - */
11   -
12   -namespace Symfony\Bundle\DoctrineBundle\Command;
13   -
14   -use Symfony\Component\Console\Input\InputArgument;
15   -use Symfony\Component\Console\Input\InputOption;
16   -use Symfony\Component\Console\Input\InputInterface;
17   -use Symfony\Component\Console\Output\OutputInterface;
18   -use Doctrine\ORM\Tools\EntityRepositoryGenerator;
19   -use Symfony\Bundle\DoctrineBundle\Mapping\DisconnectedMetadataFactory;
20   -
21   -/**
22   - * Generate entity classes from mapping information
23   - *
24   - * @author Fabien Potencier <fabien@symfony.com>
25   - * @author Jonathan H. Wage <jonwage@gmail.com>
26   - */
27   -class GenerateEntitiesDoctrineCommand extends DoctrineCommand
28   -{
29   - protected function configure()
30   - {
31   - $this
32   - ->setName('doctrine:generate:entities')
33   - ->setAliases(array('generate:doctrine:entities'))
34   - ->setDescription('Generate entity classes and method stubs from your mapping information')
35   - ->addArgument('name', InputArgument::REQUIRED, 'A bundle name, a namespace, or a class name')
36   - ->addOption('path', null, InputOption::VALUE_REQUIRED, 'The path where to generate entities when it cannot be guessed')
37   - ->addOption('no-backup', null, InputOption::VALUE_NONE, 'Do not backup existing entities files.')
38   - ->setHelp(<<<EOT
39   -The <info>doctrine:generate:entities</info> command generates entity classes
40   -and method stubs from your mapping information:
41   -
42   -You have to limit generation of entities:
43   -
44   -* To a bundle:
45   -
46   - <info>php app/console doctrine:generate:entities MyCustomBundle</info>
47   -
48   -* To a single entity:
49   -
50   - <info>php app/console doctrine:generate:entities MyCustomBundle:User</info>
51   - <info>php app/console doctrine:generate:entities MyCustomBundle/Entity/User</info>
52   -
53   -* To a namespace
54   -
55   - <info>php app/console doctrine:generate:entities MyCustomBundle/Entity</info>
56   -
57   -If the entities are not stored in a bundle, and if the classes do not exist,
58   -the command has no way to guess where they should be generated. In this case,
59   -you must provide the <comment>--path</comment> option:
60   -
61   - <info>php app/console doctrine:generate:entities Blog/Entity --path=src/</info>
62   -
63   -By default, the unmodified version of each entity is backed up and saved
64   -(e.g. Product.php~). To prevent this task from creating the backup file,
65   -pass the <comment>--no-backup</comment> option:
66   -
67   - <info>php app/console doctrine:generate:entities Blog/Entity --no-backup</info>
68   -
69   -<error>Important:</error> Even if you specified Inheritance options in your
70   -XML or YAML Mapping files the generator cannot generate the base and
71   -child classes for you correctly, because it doesn't know which
72   -class is supposed to extend which. You have to adjust the entity
73   -code manually for inheritance to work!
74   -
75   -EOT
76   - );
77   - }
78   -
79   - protected function execute(InputInterface $input, OutputInterface $output)
80   - {
81   - $manager = new DisconnectedMetadataFactory($this->getContainer()->get('doctrine'));
82   -
83   - try {
84   - $bundle = $this->getApplication()->getKernel()->getBundle($input->getArgument('name'));
85   -
86   - $output->writeln(sprintf('Generating entities for bundle "<info>%s</info>"', $bundle->getName()));
87   - $metadata = $manager->getBundleMetadata($bundle);
88   - } catch (\InvalidArgumentException $e) {
89   - $name = strtr($input->getArgument('name'), '/', '\\');
90   -
91   - if (false !== $pos = strpos($name, ':')) {
92   - $name = $this->getContainer()->get('doctrine')->getEntityNamespace(substr($name, 0, $pos)).'\\'.substr($name, $pos + 1);
93   - }
94   -
95   - if (class_exists($name)) {
96   - $output->writeln(sprintf('Generating entity "<info>%s</info>"', $name));
97   - $metadata = $manager->getClassMetadata($name, $input->getOption('path'));
98   - } else {
99   - $output->writeln(sprintf('Generating entities for namespace "<info>%s</info>"', $name));
100   - $metadata = $manager->getNamespaceMetadata($name, $input->getOption('path'));
101   - }
102   - }
103   -
104   - $generator = $this->getEntityGenerator();
105   -
106   - $backupExisting = !$input->getOption('no-backup');
107   - $generator->setBackupExisting($backupExisting);
108   -
109   - $repoGenerator = new EntityRepositoryGenerator();
110   - foreach ($metadata->getMetadata() as $m) {
111   - if ($backupExisting) {
112   - $basename = substr($m->name, strrpos($m->name, '\\') + 1);
113   - $output->writeln(sprintf(' > backing up <comment>%s.php</comment> to <comment>%s.php~</comment>', $basename, $basename));
114   - }
115   - // Getting the metadata for the entity class once more to get the correct path if the namespace has multiple occurrences
116   - try {
117   - $entityMetadata = $manager->getClassMetadata($m->getName(), $input->getOption('path'));
118   - } catch (\RuntimeException $e) {
119   - // fall back to the bundle metadata when no entity class could be found
120   - $entityMetadata = $metadata;
121   - }
122   -
123   - $output->writeln(sprintf(' > generating <comment>%s</comment>', $m->name));
124   - $generator->generate(array($m), $entityMetadata->getPath());
125   -
126   - if ($m->customRepositoryClassName && false !== strpos($m->customRepositoryClassName, $metadata->getNamespace())) {
127   - $repoGenerator->writeEntityRepositoryClass($m->customRepositoryClassName, $metadata->getPath());
128   - }
129   - }
130   - }
131   -}
123 src/Symfony/Bundle/DoctrineBundle/Command/ImportMappingDoctrineCommand.php
... ... @@ -1,123 +0,0 @@
1   -<?php
2   -
3   -/*
4   - * This file is part of the Symfony package.
5   - *
6   - * (c) Fabien Potencier <fabien@symfony.com>
7   - *
8   - * For the full copyright and license information, please view the LICENSE
9   - * file that was distributed with this source code.
10   - */
11   -
12   -namespace Symfony\Bundle\DoctrineBundle\Command;
13   -
14   -use Symfony\Component\Console\Input\InputArgument;
15   -use Symfony\Component\Console\Input\InputOption;
16   -use Symfony\Component\Console\Input\InputInterface;
17   -use Symfony\Component\Console\Output\OutputInterface;
18   -use Doctrine\ORM\Mapping\Driver\DatabaseDriver;
19   -use Doctrine\ORM\Tools\DisconnectedClassMetadataFactory;
20   -use Doctrine\ORM\Tools\Export\ClassMetadataExporter;
21   -use Doctrine\ORM\Tools\Console\MetadataFilter;
22   -
23   -/**
24   - * Import Doctrine ORM metadata mapping information from an existing database.
25   - *
26   - * @author Fabien Potencier <fabien@symfony.com>
27   - * @author Jonathan H. Wage <jonwage@gmail.com>
28   - */
29   -class ImportMappingDoctrineCommand extends DoctrineCommand
30   -{
31   - protected function configure()
32   - {
33   - $this
34   - ->setName('doctrine:mapping:import')
35   - ->addArgument('bundle', InputArgument::REQUIRED, 'The bundle to import the mapping information to')
36   - ->addArgument('mapping-type', InputArgument::OPTIONAL, 'The mapping type to export the imported mapping information to')
37   - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
38   - ->addOption('filter', null, InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'A string pattern used to match entities that should be mapped.')
39   - ->addOption('force', null, InputOption::VALUE_NONE, 'Force to overwrite existing mapping files.')
40   - ->setDescription('Import mapping information from an existing database')
41   - ->setHelp(<<<EOT
42   -The <info>doctrine:mapping:import</info> command imports mapping information
43   -from an existing database:
44   -
45   -<info>php app/console doctrine:mapping:import "MyCustomBundle" xml</info>
46   -
47   -You can also optionally specify which entity manager to import from with the
48   -<info>--em</info> option:
49   -
50   -<info>php app/console doctrine:mapping:import "MyCustomBundle" xml --em=default</info>
51   -
52   -If you don't want to map every entity that can be found in the database, use the
53   -<info>--filter</info> option. It will try to match the targeted mapped entity with the
54   -provided pattern string.
55   -
56   -<info>php app/console doctrine:mapping:import "MyCustomBundle" xml --filter=MyMatchedEntity</info>
57   -
58   -Use the <info>--force</info> option, if you want to override existing mapping files:
59   -
60   -<info>php app/console doctrine:mapping:import "MyCustomBundle" xml --force</info>
61   -EOT
62   - );
63   - }
64   -
65   - protected function execute(InputInterface $input, OutputInterface $output)
66   - {
67   - $bundle = $this->getApplication()->getKernel()->getBundle($input->getArgument('bundle'));
68   -
69   - $destPath = $bundle->getPath();
70   - $type = $input->getArgument('mapping-type') ? $input->getArgument('mapping-type') : 'xml';
71   - if ('annotation' === $type) {
72   - $destPath .= '/Entity';
73   - } else {
74   - $destPath .= '/Resources/config/doctrine';
75   - }
76   - if ('yaml' === $type) {
77   - $type = 'yml';
78   - }
79   -
80   - $cme = new ClassMetadataExporter();
81   - $exporter = $cme->getExporter($type);
82   - $exporter->setOverwriteExistingFiles($input->getOption('force'));
83   -
84   - if ('annotation' === $type) {
85   - $entityGenerator = $this->getEntityGenerator();
86   - $exporter->setEntityGenerator($entityGenerator);
87   - }
88   -
89   - $em = $this->getEntityManager($input->getOption('em'));
90   -
91   - $databaseDriver = new DatabaseDriver($em->getConnection()->getSchemaManager());
92   - $em->getConfiguration()->setMetadataDriverImpl($databaseDriver);
93   -
94   - $emName = $input->getOption('em');
95   - $emName = $emName ? $emName : 'default';
96   -
97   - $cmf = new DisconnectedClassMetadataFactory();
98   - $cmf->setEntityManager($em);
99   - $metadata = $cmf->getAllMetadata();
100   - $metadata = MetadataFilter::filter($metadata, $input->getOption('filter'));
101   - if ($metadata) {
102   - $output->writeln(sprintf('Importing mapping information from "<info>%s</info>" entity manager', $emName));
103   - foreach ($metadata as $class) {
104   - $className = $class->name;
105   - $class->name = $bundle->getNamespace().'\\Entity\\'.$className;
106   - if ('annotation' === $type) {
107   - $path = $destPath.'/'.$className.'.php';
108   - } else {
109   - $path = $destPath.'/'.$className.'.orm.'.$type;
110   - }
111   - $output->writeln(sprintf(' > writing <comment>%s</comment>', $path));
112   - $code = $exporter->exportClassMetadata($class);
113   - if (!is_dir($dir = dirname($path))) {
114   - mkdir($dir, 0777, true);
115   - }
116   - file_put_contents($path, $code);
117   - }
118   - } else {
119   - $output->writeln('Database does not have any mapping information.', 'ERROR');
120   - $output->writeln('', 'ERROR');
121   - }
122   - }
123   -}
86 src/Symfony/Bundle/DoctrineBundle/Command/InfoDoctrineCommand.php
... ... @@ -1,86 +0,0 @@
1   -<?php
2   -
3   -/*
4   - * This file is part of the Symfony package.
5   - *
6   - * (c) Fabien Potencier <fabien@symfony.com>
7   - *
8   - * For the full copyright and license information, please view the LICENSE
9   - * file that was distributed with this source code.
10   - */
11   -
12   -namespace Symfony\Bundle\DoctrineBundle\Command;
13   -
14   -use Doctrine\ORM\Mapping\MappingException;
15   -use Symfony\Component\Console\Input\InputOption;
16   -use Symfony\Component\Console\Input\InputInterface;
17   -use Symfony\Component\Console\Output\OutputInterface;
18   -
19   -/**
20   - * Show information about mapped entities
21   - *
22   - * @author Benjamin Eberlei <kontakt@beberlei.de>
23   - */
24   -class InfoDoctrineCommand extends DoctrineCommand
25   -{
26   - protected function configure()
27   - {
28   - $this
29   - ->setName('doctrine:mapping:info')
30   - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
31   - ->setDescription('Show basic information about all mapped entities')
32   - ->setHelp(<<<EOT
33   -The <info>doctrine:mapping:info</info> shows basic information about which
34   -entities exist and possibly if their mapping information contains errors or
35   -not.
36   -
37   -<info>php app/console doctrine:mapping:info</info>
38   -
39   -If you are using multiple entity managers you can pick your choice with the
40   -<info>--em</info> option:
41   -
42   -<info>php app/console doctrine:mapping:info --em=default</info>
43   -EOT
44   - );
45   - }
46   -
47   - protected function execute(InputInterface $input, OutputInterface $output)
48   - {
49   - $entityManagerName = $input->getOption('em') ? $input->getOption('em') : $this->getContainer()->get('doctrine')->getDefaultManagerName();
50   -
51   - /* @var $entityManager Doctrine\ORM\EntityManager */
52   - $entityManager = $this->getEntityManager($input->getOption('em'));
53   -
54   - $entityClassNames = $entityManager->getConfiguration()
55   - ->getMetadataDriverImpl()
56   - ->getAllClassNames();
57   -
58   - if (!$entityClassNames) {
59   - throw new \LogicException(
60   - 'You do not have any mapped Doctrine ORM entities for any of your bundles. '.
61   - 'Create a class inside the Entity namespace of any of your bundles and provide '.
62   - 'mapping information for it with Annotations directly in the classes doc blocks '.
63   - 'or with XML/YAML in your bundles Resources/config/doctrine/ directory.'
64   - );
65   - }
66   -
67   - $output->writeln(sprintf("Found <info>%d</info> entities mapped in entity manager <info>%s</info>:", count($entityClassNames), $entityManagerName));
68   -
69   - foreach ($entityClassNames as $entityClassName) {
70   - try {
71   - $cm = $entityManager->getClassMetadata($entityClassName);
72   - $output->writeln(sprintf("<info>[OK]</info> %s", $entityClassName));
73   - } catch (MappingException $e) {
74   - $message = $e->getMessage();
75   - while ($e->getPrevious()) {
76   - $e = $e->getPrevious();
77   - $message .= "\n" . $e->getMessage();
78   - }
79   -
80   - $output->writeln("<error>[FAIL]</error> ".$entityClassName);
81   - $output->writeln(sprintf("<comment>%s</comment>", $message));
82   - $output->writeln('');
83   - }
84   - }
85   - }
86   -}
55 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/ClearMetadataCacheDoctrineCommand.php
... ... @@ -1,55 +0,0 @@
1   -<?php
2   -
3   -/*
4   - * This file is part of the Symfony package.
5   - *
6   - * (c) Fabien Potencier <fabien@symfony.com>
7   - *
8   - * For the full copyright and license information, please view the LICENSE
9   - * file that was distributed with this source code.
10   - */
11   -
12   -namespace Symfony\Bundle\DoctrineBundle\Command\Proxy;
13   -
14   -use Symfony\Component\Console\Input\InputOption;
15   -use Symfony\Component\Console\Input\InputInterface;
16   -use Symfony\Component\Console\Output\OutputInterface;
17   -use Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand;
18   -
19   -/**
20   - * Command to clear the metadata cache of the various cache drivers.
21   - *
22   - * @author Fabien Potencier <fabien@symfony.com>
23   - * @author Jonathan H. Wage <jonwage@gmail.com>
24   - */
25   -class ClearMetadataCacheDoctrineCommand extends MetadataCommand
26   -{
27   - protected function configure()
28   - {
29   - parent::configure();
30   -
31   - $this
32   - ->setName('doctrine:cache:clear-metadata')
33   - ->setDescription('Clear all metadata cache for a entity manager')
34   - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
35   - ->setHelp(<<<EOT
36   -The <info>doctrine:cache:clear-metadata</info> command clears all metadata
37   -cache for the default entity manager:
38   -
39   -<info>php app/console doctrine:cache:clear-metadata</info>
40   -
41   -You can also optionally specify the <comment>--em</comment> option to specify
42   -which entity manager to clear the cache for:
43   -
44   -<info>php app/console doctrine:cache:clear-metadata --em=default</info>
45   -EOT
46   - );
47   - }
48   -
49   - protected function execute(InputInterface $input, OutputInterface $output)
50   - {
51   - DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
52   -
53   - return parent::execute($input, $output);
54   - }
55   -}
55 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/ClearQueryCacheDoctrineCommand.php
... ... @@ -1,55 +0,0 @@
1   -<?php
2   -
3   -/*
4   - * This file is part of the Symfony package.
5   - *
6   - * (c) Fabien Potencier <fabien@symfony.com>
7   - *
8   - * For the full copyright and license information, please view the LICENSE
9   - * file that was distributed with this source code.
10   - */
11   -
12   -namespace Symfony\Bundle\DoctrineBundle\Command\Proxy;
13   -
14   -use Symfony\Component\Console\Input\InputOption;
15   -use Symfony\Component\Console\Input\InputInterface;
16   -use Symfony\Component\Console\Output\OutputInterface;
17   -use Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand;
18   -
19   -/**
20   - * Command to clear the query cache of the various cache drivers.
21   - *
22   - * @author Fabien Potencier <fabien@symfony.com>
23   - * @author Jonathan H. Wage <jonwage@gmail.com>
24   - */
25   -class ClearQueryCacheDoctrineCommand extends QueryCommand
26   -{
27   - protected function configure()
28   - {
29   - parent::configure();
30   -
31   - $this
32   - ->setName('doctrine:cache:clear-query')
33   - ->setDescription('Clear all query cache for a entity manager')
34   - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
35   - ->setHelp(<<<EOT
36   -The <info>doctrine:cache:clear-query</info> command clears all query cache for
37   -the default entity manager:
38   -
39   -<info>php app/console doctrine:cache:clear-query</info>
40   -
41   -You can also optionally specify the <comment>--em</comment> option to specify
42   -which entity manager to clear the cache for:
43   -
44   -<info>php app/console doctrine:cache:clear-query --em=default</info>
45   -EOT
46   - );
47   - }
48   -
49   - protected function execute(InputInterface $input, OutputInterface $output)
50   - {
51   - DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
52   -
53   - return parent::execute($input, $output);
54   - }
55   -}
70 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/ClearResultCacheDoctrineCommand.php
... ... @@ -1,70 +0,0 @@
1   -<?php
2   -
3   -/*
4   - * This file is part of the Symfony package.
5   - *
6   - * (c) Fabien Potencier <fabien@symfony.com>
7   - *
8   - * For the full copyright and license information, please view the LICENSE
9   - * file that was distributed with this source code.
10   - */
11   -
12   -namespace Symfony\Bundle\DoctrineBundle\Command\Proxy;
13   -
14   -use Symfony\Component\Console\Input\InputOption;
15   -use Symfony\Component\Console\Input\InputInterface;
16   -use Symfony\Component\Console\Output\OutputInterface;
17   -use Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand;
18   -
19   -/**
20   - * Command to clear the result cache of the various cache drivers.
21   - *
22   - * @author Fabien Potencier <fabien@symfony.com>
23   - * @author Jonathan H. Wage <jonwage@gmail.com>
24   - */
25   -class ClearResultCacheDoctrineCommand extends ResultCommand
26   -{
27   - protected function configure()
28   - {
29   - parent::configure();
30   -
31   - $this
32   - ->setName('doctrine:cache:clear-result')
33   - ->setDescription('Clear result cache for a entity manager')
34   - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
35   - ->setHelp(<<<EOT
36   -The <info>doctrine:cache:clear-result</info> command clears all result cache
37   -for the default entity manager:
38   -
39   -<info>php app/console doctrine:cache:clear-result</info>
40   -
41   -You can also optionally specify the <comment>--em</comment> option to specify
42   -which entity manager to clear the cache for:
43   -
44   -<info>php app/console doctrine:cache:clear-result --em=default</info>
45   -
46   -If you don't want to clear all result cache you can specify some additional
47   -options to control what cache is deleted:
48   -
49   -<info>php app/console doctrine:cache:clear-result --id=cache_key</info>
50   -
51   -Or you can specify a <comment>--regex</comment> to delete cache entries that
52   -match it:
53   -
54   -<info>php app/console doctrine:cache:clear-result --regex="user_(.*)"</info>
55   -
56   -You can also specify a <comment>--prefix</comment> or
57   -<comment>--suffix</comment> to delete cache entries for:
58   -
59   -<info>php app/console doctrine:cache:clear-result --prefix="user_" --suffix="_frontend"</info>
60   -EOT
61   - );
62   - }
63   -
64   - protected function execute(InputInterface $input, OutputInterface $output)
65   - {
66   - DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
67   -
68   - return parent::execute($input, $output);
69   - }
70   -}
65 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/ConvertMappingDoctrineCommand.php
... ... @@ -1,65 +0,0 @@
1   -<?php
2   -
3   -/*
4   - * This file is part of the Symfony package.
5   - *
6   - * (c) Fabien Potencier <fabien@symfony.com>
7   - *
8   - * For the full copyright and license information, please view the LICENSE
9   - * file that was distributed with this source code.
10   - */
11   -
12   -namespace Symfony\Bundle\DoctrineBundle\Command\Proxy;
13   -
14   -use Symfony\Component\Console\Input\InputOption;
15   -use Symfony\Component\Console\Input\InputInterface;
16   -use Symfony\Component\Console\Output\OutputInterface;
17   -use Symfony\Component\Console\Output\Output;
18   -use Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand;
19   -use Doctrine\ORM\Tools\Export\Driver\XmlExporter;
20   -use Doctrine\ORM\Tools\Export\Driver\YamlExporter;
21   -
22   -/**
23   - * Convert Doctrine ORM metadata mapping information between the various supported
24   - * formats.
25   - *
26   - * @author Fabien Potencier <fabien@symfony.com>
27   - * @author Jonathan H. Wage <jonwage@gmail.com>
28   - */
29   -class ConvertMappingDoctrineCommand extends ConvertMappingCommand
30   -{
31   - protected function configure()
32   - {
33   - parent::configure();
34   - $this
35   - ->setName('doctrine:mapping:convert')
36   - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
37   - ->setHelp(<<<EOT
38   -The <info>doctrine:mapping:convert</info> command converts mapping information
39   -between supported formats:
40   -
41   -<info>php app/console doctrine:mapping:convert xml /path/to/output</info>
42   -EOT
43   - );
44   - }
45   -
46   - protected function execute(InputInterface $input, OutputInterface $output)
47   - {
48   - DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
49   -
50   - return parent::execute($input, $output);
51   - }
52   -
53   -
54   - protected function getExporter($toType, $destPath)
55   - {
56   - $exporter = parent::getExporter($toType, $destPath);
57   - if ($exporter instanceof XmlExporter) {
58   - $exporter->setExtension('.orm.xml');
59   - } elseif ($exporter instanceof YamlExporter) {
60   - $exporter->setExtension('.orm.yml');
61   - }
62   -
63   - return $exporter;
64   - }
65   -}
60 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/CreateSchemaDoctrineCommand.php
... ... @@ -1,60 +0,0 @@
1   -<?php
2   -
3   -/*
4   - * This file is part of the Symfony package.
5   - *
6   - * (c) Fabien Potencier <fabien@symfony.com>
7   - *
8   - * For the full copyright and license information, please view the LICENSE
9   - * file that was distributed with this source code.
10   - */
11   -
12   -namespace Symfony\Bundle\DoctrineBundle\Command\Proxy;
13   -
14   -use Symfony\Component\Console\Input\InputOption;
15   -use Symfony\Component\Console\Input\InputInterface;
16   -use Symfony\Component\Console\Output\OutputInterface;
17   -use Symfony\Component\Console\Output\Output;
18   -use Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand;
19   -
20   -/**
21   - * Command to execute the SQL needed to generate the database schema for
22   - * a given entity manager.
23   - *
24   - * @author Fabien Potencier <fabien@symfony.com>
25   - * @author Jonathan H. Wage <jonwage@gmail.com>
26   - */
27   -class CreateSchemaDoctrineCommand extends CreateCommand
28   -{
29   - protected function configure()
30   - {
31   - parent::configure();
32   -
33   - $this
34   - ->setName('doctrine:schema:create')
35   - ->setDescription('Executes (or dumps) the SQL needed to generate the database schema')
36   - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
37   - ->setHelp(<<<EOT
38   -The <info>doctrine:schema:create</info> command executes the SQL needed to
39   -generate the database schema for the default entity manager:
40   -
41   -<info>php app/console doctrine:schema:create</info>
42   -
43   -You can also generate the database schema for a specific entity manager:
44   -
45   -<info>php app/console doctrine:schema:create --em=default</info>
46   -
47   -Finally, instead of executing the SQL, you can output the SQL:
48   -
49   -<info>php app/console doctrine:schema:create --dump-sql</info>
50   -EOT
51   - );
52   - }
53   -
54   - protected function execute(InputInterface $input, OutputInterface $output)
55   - {
56   - DoctrineCommandHelper::setApplicationEntityManager($this->getApplication(), $input->getOption('em'));
57   -
58   - parent::execute($input, $output);
59   - }
60   -}
46 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/DoctrineCommandHelper.php
... ... @@ -1,46 +0,0 @@
1   -<?php
2   -
3   -/*
4   - * This file is part of the Symfony package.
5   - *
6   - * (c) Fabien Potencier <fabien@symfony.com>
7   - *
8   - * For the full copyright and license information, please view the LICENSE
9   - * file that was distributed with this source code.
10   - */
11   -
12   -namespace Symfony\Bundle\DoctrineBundle\Command\Proxy;
13   -
14   -use Symfony\Component\Console\Application;
15   -use Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper;
16   -use Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper;
17   -
18   -/**
19   - * Provides some helper and convenience methods to configure doctrine commands in the context of bundles
20   - * and multiple connections/entity managers.
21   - *
22   - * @author Fabien Potencier <fabien@symfony.com>
23   - */
24   -abstract class DoctrineCommandHelper
25   -{
26   - /**
27   - * Convenience method to push the helper sets of a given entity manager into the application.
28   - *
29   - * @param Application $application
30   - * @param string $emName
31   - */
32   - static public function setApplicationEntityManager(Application $application, $emName)
33   - {
34   - $em = $application->getKernel()->getContainer()->get('doctrine')->getManager($emName);
35   - $helperSet = $application->getHelperSet();
36   - $helperSet->set(new ConnectionHelper($em->getConnection()), 'db');
37   - $helperSet->set(new EntityManagerHelper($em), 'em');
38   - }
39   -
40   - static public function setApplicationConnection(Application $application, $connName)
41   - {
42   - $connection = $application->getKernel()->getContainer()->get('doctrine')->getConnection($connName);
43   - $helperSet = $application->getHelperSet();
44   - $helperSet->set(new ConnectionHelper($connection), 'db');
45   - }
46   -}
60 src/Symfony/Bundle/DoctrineBundle/Command/Proxy/DropSchemaDoctrineCommand.php
... ... @@ -1,60 +0,0 @@
1   -<?php
2   -
3   -/*
4   - * This file is part of the Symfony package.
5   - *
6   - * (c) Fabien Potencier <fabien@symfony.com>
7   - *
8   - * For the full copyright and license information, please view the LICENSE
9   - * file that was distributed with this source code.
10   - */
11   -
12   -namespace Symfony\Bundle\DoctrineBundle\Command\Proxy;
13   -
14   -use Symfony\Component\Console\Input\InputOption;
15   -use Symfony\Component\Console\Input\InputInterface;
16   -use Symfony\Component\Console\Output\OutputInterface;
17   -use Symfony\Component\Console\Output\Output;
18   -use Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand;
19   -
20   -/**
21   - * Command to drop the database schema for a set of classes based on their mappings.
22   - *
23   - * @author Fabien Potencier <fabien@symfony.com>
24   - * @author Jonathan H. Wage <jonwage@gmail.com>
25   - */
26   -class DropSchemaDoctrineCommand extends DropCommand
27   -{
28   - protected function configure()
29   - {
30   - parent::configure();
31   -
32   - $this
33   - ->setName('doctrine:schema:drop')
34   - ->setDescription('Executes (or dumps) the SQL needed to drop the current database schema')
35   - ->addOption('em', null, InputOption::VALUE_OPTIONAL, 'The entity manager to use for this command')
36   - ->setHelp(<<<EOT
37   -The <info>doctrine:schema:drop</info> command generates the SQL needed to
38   -drop the database schema of the default entity manager:
39   -
40   -<info>php app/console doctrine:schema:drop --dump-sql</info>
41   -
42   -Alternatively, you can execute the generated queries:
43   -
44   -<info>php app/console doctrine:schema:drop --force</info>
45   -
46   -You can also optionally specify the name of a entity manager to drop the
47   -schema for:
48   -