/
DropSchemaDoctrineODMCommand.php
44 lines (35 loc) · 1.42 KB
/
DropSchemaDoctrineODMCommand.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
<?php
namespace Symfony\Bundle\DoctrineMongoDBBundle\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Output\Output;
use Doctrine\ODM\MongoDB\Tools\Console\Command\Schema\DropCommand;
/**
* Command to create the database schema for a set of classes based on their mappings.
*
* @author Justin Hileman <justin@shopopensky.com>
*/
class DropSchemaDoctrineODMCommand extends DropCommand
{
protected function configure()
{
parent::configure();
$this
->setName('doctrine:mongodb:schema:drop')
->addOption('dm', null, InputOption::PARAMETER_REQUIRED, 'The document manager to use for this command.')
->setHelp(<<<EOT
The <info>doctrine:mongodb:schema:drop</info> command drops the default document manager's schema:
<info>./symfony doctrine:mongodb:schema:drop</info>
You can also optionally specify the name of a document manager to drop the schema for:
<info>./symfony doctrine:mongodb:schema:drop --dm=default</info>
EOT
);
}
protected function execute(InputInterface $input, OutputInterface $output)
{
DoctrineODMCommand::setApplicationDocumentManager($this->application, $input->getOption('dm'));
parent::execute($input, $output);
}
}