»
S
I
D
E
B
A
R
«
Extend Schema in Other Plugins for symfony
October 11th, 2009 by wood

If you already have a config/schema.yml and some day you need to extend it in other plugins.
There is someway in symfony that it could auto merge schema.yml with the same phpName you
provided.

For example, if you alreay have a sf_guard_user_profile table in config/schema.yml and
it has _attribute { phpName: sfGuardUserProfile }
For some purpose, your plugin sfMyPlugin needs to add a new column in sfGuardUserProfile Table,
The cleanest way I know is, add the new column in sfMyPlugin/conig/schema.custom.yml
with the same phpName: _attribute { phpName:sfGuardProfie}

While doing this, symfony can identify that there is a new column in sfMyPlugin and will merge it
automatically when you doing “symfony propel:build-all”

The detailed information is in The Definitive Guide to Symfony Ch 17 Extending Symfony


Leave a Reply

»  Substance: PHP Frameworks   »  SiteMap