Development

sfDoctrinePluginDev

You must first sign up to be able to contribute.

sfDoctrinePlugin developer page

Here we want to summarize our discussions about the developement of sfDoctrinePlugin, mostly changes for symfony 1.1.

New tasks

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!
build-all
drop-db, build-db, build-model
build-all-load
build-all, load-data
build-db
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-model
Build Doctrine classes from schema files. Same here: What about multiple databases?
build-schema
Creates a schema.yml from an existing database (Doctrine_Import). Should also support multiple databases.
build-sql
Creates SQL for the current model.
data-dump
Dumps data to the fixtures directory.
data-load
Loads data from fixtures directory.
generate-crud
Generates a Doctrine CRUD module.
init-admin
Initializes a Doctrine admin module.
init-crud
Initializes a Doctrine CRUD module.
insert-sql
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:

convert-from-propel
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:

import
Or import-classes: Builds Doctrine classes from an existing database.
export
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