Doctrine allows schema files (schema.yml in my case as symfony user) to define global settings that shall be valid for each class (within the same schema file) to be taken as default unless specified otherwise within the class.
However, once an individual class does specify (even only) one single option, none of the global options are being used anymore at all. This is the current implementation as of in Doctrine_Import_Schema::parseSchema(), line 330.
IMHO this implementation makes the feature of rather little benefit for users, particularly because 'options' is an array, even a nested one since symfony 1.3 did introduce their own options therein ('forms' and 'filters').
After an import with the current implementation, the classes end up having the following options:
As a developer I originally understood the feature in that DocumentSource and DocumentType would still get the global option settings like collate, charset etc without having to repeat them again and again.
- Like e.g. for DocumentSource:
--> is the effect of the current implementation is intentional?
I.e. I wish to raise the question: shall globals...
- only be applicable to an individual class if the latter doesn't specifiy any option at all? (principle of XOR), or
- complement the class' individual options, i.e. the developer defines the desired default options as globals, and specifies any difference from that in the individual class? (principle of inheritance).
IMHO as a user of Doctrine & Symfony, I cleary prefer the inheritance principle (2).
A thinkable solution is to use array_replace_recursive() or a similar function instead of a simple assignment:
I haven't yet tried out this patch nor even tested it, since anything first depends from a clarification on the common expectations from the feature of globals in schema files.
PS. update: I created a corresponding issue in Symfony trac.