Development

sfDoctrinePluginDev (diff)

You must first sign up to be able to contribute.

Changes from Version 1 of sfDoctrinePluginDev

Show
Ignore:
Author:
mahono (IP: 89.57.153.23)
Timestamp:
09/26/07 18:56:25 (10 years ago)
Comment:

initial content for sfDoctrinePlugin developer page

Legend:

Unmodified
Added
Removed
Modified
  • sfDoctrinePluginDev

    v0 v1  
     1= sfDoctrinePlugin developer page = 
     2 
     3Here we want to summarize our discussions about the developement of sfDoctrinePlugin, mostly changes for symfony 1.1. 
     4 
     5== New tasks == 
     6 
     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. 
     8 
     9Almost all tasks have these two problems: 
     10 
     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! 
     13 
     14 '''build-all''':: 
     15  drop-db, build-db, build-model 
     16 
     17 '''build-all-load''':: 
     18  build-all, load-data 
     19 
     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! 
     24 
     25 '''build-model''':: 
     26  Build Doctrine classes from schema files. Same here: What about multiple databases? 
     27 
     28 '''build-schema''':: 
     29  Creates a schema.yml from an existing database (Doctrine_Import). Should also support multiple databases. 
     30 
     31 '''build-sql''':: 
     32  Creates SQL for the current model. 
     33 
     34 '''data-dump''':: 
     35  Dumps data to the fixtures directory. 
     36 
     37 '''data-load''':: 
     38  Loads data from fixtures directory. 
     39 
     40 '''generate-crud''':: 
     41  Generates a Doctrine CRUD module. 
     42 
     43 '''init-admin''':: 
     44  Initializes a Doctrine admin module. 
     45 
     46 '''init-crud''':: 
     47  Initializes a Doctrine CRUD module. 
     48 
     49 '''insert-sql''':: 
     50  Inserts SQL for current model. 
     51 
     52 
     53The old Propel / schema convert tasks should be renamed. For example "doctrine-import" is not a good choice. Some ideas: 
     54 
     55 '''convert-from-propel''':: 
     56  Converts Propel schema.xml into Doctrine schema.yml (was doctrine-import) 
     57 
     58 
     59Would also be nice to have some tasks that are called the same they are called in Doctrine, for example: 
     60 
     61 '''import''':: 
     62  Or import-classes: Builds Doctrine classes from an existing database. 
     63 
     64 '''export''':: 
     65  Or export-classes: Creates a database from existing Doctrine classes. 
     66 
     67 
     68We also need brand new tasks for Doctrine_Migration and other cool stuff! 
     69 
     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. 
     71 
     72Example for Doctrine_Record implementation: 
     73 
     74{{{ 
     75implementations: 
     76  UserTemplate: MyUser 
     77  ShoppingCartTemplate: MyShoppingCart 
     78}}} 
     79 
     80 
     81 
     82 
     83 
     84 
     85