sfDoctrinePlugin developer page
Here we want to summarize our discussions about the developement of sfDoctrinePlugin, mostly changes for symfony 1.1.
All tasks have the namespace "doctrine". So a full task name is for example doctrine:init-admin. Task names are taken from symfony 1.1 / Propel to support a consistent naming concept.
Almost all tasks have these two problems:
- We need a way to work with multiple databases.
- We need a way to work with both, schema file based models and plain Doctrine models. Tasks must look in plugin dirs for Doctrine_Records, too!
- drop-db, build-db, build-model
- build-all, load-data
- Creates database for current model (Doctrine_Export). Question: If you have multiple databases: Should it create ALL databases or should we introduce a parameter "connectionName"? For use without schema files the task must als look into plugins for model classes!
- Build Doctrine classes from schema files. Same here: What about multiple databases?
- Creates a schema.yml from an existing database (Doctrine_Import). Should also support multiple databases.
- Creates SQL for the current model.
- Dumps data to the fixtures directory.
- Loads data from fixtures directory.
- Generates a Doctrine CRUD module.
- Initializes a Doctrine admin module.
- Initializes a Doctrine CRUD module.
- Inserts SQL for current model.
The old Propel / schema convert tasks should be renamed. For example "doctrine-import" is not a good choice. Some ideas:
- Converts Propel schema.xml into Doctrine schema.yml (was doctrine-import)
Would also be nice to have some tasks that are called the same they are called in Doctrine, for example:
- Or import-classes: Builds Doctrine classes from an existing database.
- Or export-classes: Creates a database from existing Doctrine classes.
We also need brand new tasks for Doctrine_Migration and other cool stuff!
And there must be a way to configure things like Doctrine_Template implementations. Either we introduce a / some new config files or we put all into doctrine.yml.
Example for Doctrine_Record implementation:
implementations: UserTemplate: MyUser ShoppingCartTemplate: MyShoppingCart