Download the PHP package pandora/doctrine-generator-bundle without Composer
On this page you can find all versions of the php package pandora/doctrine-generator-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package doctrine-generator-bundle
Symfony2 bundle to generate model or interface class
Installation
-
Add bundle as dependency to the composer.json
- Run "composer update"
- Make sure to enable PandoraDoctrineGeneratorBundle in AppKernel.php .
Available Commands
- use doctrine:generate:model or generate:doctrine:model to generate single model class
- use doctrine:generate:models or generate:doctrine:models to generate model in bundle
Usage
doctrine:generate:model
The above command would initialize a new model in the following model namespace Acme\BlogBundle\Model\Blog\Post
You can also optionally spectify the fields you want to generate in the new model:
The command can also generate the corresponding entity repository class with the --with-repository option:
By default, the command uses annotations for the mapping information; change it with --format:
To generate or update the corresponding entity class, use the --with-entity option:
To generate the corresponding interface class, use the --with-interface option:
doctrine:generate:models
-
To a bundle:
-
To a single model:
- To a namespace:
If the entities are not stored in a bundle, and if the classes do not exist, the command has no way to guess where they should be generated. In this case, you must provide the --path option:
By default, the unmodified version of each model is backed up and saved (e.g. Product.php~). To prevent this task from creating the backup file, pass the --no-backup option:
To generate or update the corresponding entity class, use the --with-entity option:
To generate the corresponding interface class, use the --with-interface option:
Important: Even if you specified Inheritance options in your XML or YAML Mapping files the generator cannot generate the base and child classes for you correctly, because it doesnot know which class is supposed to extend which. You have to adjust the model code manually for inheritance to work!