Hello everybody,

(Context : Symfony 1.4, Doctrine 1.2)

Let's say I have 3 entities in my schema : Person, Boy, Girl, with Boy
and Girl inheriting from Person with the column_aggregation option.

So this is the simplified schema.yml :

<code>
Person:
...

Boy:
  inheritance:
    extends: Person
    type: column_aggregation
    keyField: gender
    keyValue: boy
...

Girl:
  inheritance:
    extends: Person
    type: column_aggregation
    keyField: gender
    keyValue: girl
...
</code>

Now, I would like to use the Admin generator in order to manage my Boy
& Girl entities.

The CLI commands below work as expected :
<code>
symfony doctrine:generate-admin frontend Boy
symfony doctrine:generate-admin frontend Girl
</code>

And... here is my problem. As the behaviors will be identical, I don't
want to generate two different modules.

So I generated admin for the Person entity :
<code>
symfony doctrine:generate-admin frontend Person
</code>

Then I tried to play with routing.yml options in order to route to my
two different entities. Before :
<code>
person:
  class: sfDoctrineRouteCollection
  options:
    model:                Person
    module:               person
    prefix_path:          /person
    column:               id
    with_wildcard_routes: true
</code>

After :
<code>
boy:
  class: sfDoctrineRouteCollection
  options:
    model:                Boy
    module:               person
    prefix_path:          /boy
    column:               id
    with_wildcard_routes: true

girl:
  class: sfDoctrineRouteCollection
  options:
    model:                Girl
    module:               person
    prefix_path:          /girl
    column:               id
    with_wildcard_routes: true
</code>

But this would be too easy. Indeed, in generator.yml, I must set one
model and one route prefix.
<code>
generator:
  class: sfDoctrineGenerator
  param:
    model_class:           Person
    route_prefix:          person
...
</code>

I think I could pass the "gender" parameter, and work only with Person
entities, but perhaps there is a nicer solution, using Doctrine
inheritance.

Thanks to everyone who has some clues.

Thomas
-- 
You received this message because you are subscribed to the Google Groups 
"symfony users" group.
To post to this group, send email to symfony-us...@googlegroups.com.
To unsubscribe from this group, send email to 
symfony-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/symfony-users?hl=en.


Reply via email to