sfDoctrinePluginDev (diff)

You must first sign up to be able to contribute.

Changes from Version 1 of sfDoctrinePluginDev

mahono (IP:
09/26/07 18:56:25 (10 years ago)

initial content for sfDoctrinePlugin developer page


  • sfDoctrinePluginDev

    v0 v1  
     1= sfDoctrinePlugin developer page = 
     3Here we want to summarize our discussions about the developement of sfDoctrinePlugin, mostly changes for symfony 1.1. 
     5== New tasks == 
     7All 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. 
     9Almost all tasks have these two problems: 
     11 * We need a way to work with multiple databases. 
     12 * 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! 
     14 '''build-all''':: 
     15  drop-db, build-db, build-model 
     17 '''build-all-load''':: 
     18  build-all, load-data 
     20 '''build-db''':: 
     21  Creates database for current model (Doctrine_Export). 
     22  Question: If you have multiple databases: Should it create ALL databases or should we introduce a parameter "connectionName"? 
     23  For use without schema files the task must als look into plugins for model classes! 
     25 '''build-model''':: 
     26  Build Doctrine classes from schema files. Same here: What about multiple databases? 
     28 '''build-schema''':: 
     29  Creates a schema.yml from an existing database (Doctrine_Import). Should also support multiple databases. 
     31 '''build-sql''':: 
     32  Creates SQL for the current model. 
     34 '''data-dump''':: 
     35  Dumps data to the fixtures directory. 
     37 '''data-load''':: 
     38  Loads data from fixtures directory. 
     40 '''generate-crud''':: 
     41  Generates a Doctrine CRUD module. 
     43 '''init-admin''':: 
     44  Initializes a Doctrine admin module. 
     46 '''init-crud''':: 
     47  Initializes a Doctrine CRUD module. 
     49 '''insert-sql''':: 
     50  Inserts SQL for current model. 
     53The old Propel / schema convert tasks should be renamed. For example "doctrine-import" is not a good choice. Some ideas: 
     55 '''convert-from-propel''':: 
     56  Converts Propel schema.xml into Doctrine schema.yml (was doctrine-import) 
     59Would also be nice to have some tasks that are called the same they are called in Doctrine, for example: 
     61 '''import''':: 
     62  Or import-classes: Builds Doctrine classes from an existing database. 
     64 '''export''':: 
     65  Or export-classes: Creates a database from existing Doctrine classes. 
     68We also need brand new tasks for Doctrine_Migration and other cool stuff! 
     70And 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. 
     72Example for Doctrine_Record implementation: 
     76  UserTemplate: MyUser 
     77  ShoppingCartTemplate: MyShoppingCart