You are browsing a version that has not yet been released. |
Doctrine CLI
The Doctrine CLI has been pre-configured for you and works as is without any special configuration required for MongoODM ODM and ORM. It will use your application’s configuration for entities or documents.
Access the Doctrine command line through
$ ./vendor/bin/doctrine-module
Each command provides a description of itself if called with a
--help
argument.
Adding commands to the CLI
You may add your own CLI commands by just creating new Symfony commands and attaching them to the provided CLI application as following:
1 namespace My;
use Laminas\EventManager\EventInterface;
use Laminas\ModuleManager\ModuleManagerInterface;
class Module
{
public function init(ModuleManagerInterface $manager)
{
$events = $manager->getEventManager()->getSharedManager();
// Attach to helper set event and load the entity manager helper.
$events->attach('doctrine', 'loadCli.post', function (EventInterface $e) {
/* @var $cli \Symfony\Component\Console\Application */
$cli = $e->getTarget();
$cli->add(new \My\Own\Cli\Command());
});
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20