propelorm / PropelBundle

PropelBundle for Symfony.
http://propelorm.org/Propel/documentation/#working-with-symfony2
180 stars 156 forks source link

Move Form classes to a bridge component #21

Closed GromNaN closed 12 years ago

GromNaN commented 13 years ago

In Symfony2, all classes making relations between components has been moved to some "Bridge" components. It's explained here: http://groups.google.com/group/symfony-devs/browse_thread/thread/ae49ea50a3731628/c5b268d63f195a19

The PropelBundle contain a lot of interesting things to work with Symfony Form Component.

In order to use Propel with the Form component outside of the framework, it would be useful to move the Propel\PropelBundle\Form classes out of the bundle. Something like Propel\Bridge\Form.

willdurand commented 13 years ago

Hi Jerome,

It's a good idea but how to do that ? Another bundle ? I don't want to have two bundles nor to create the bridge in this bundle because it does not make sense. The Symfony2 core comes with both bridge and main features. Same thing with this bundle and this is an expected bevavior according to the bundle principle. That's why this point makes me dubious about what you want (even if I agree with you).

Feel free to explain me your mind a bit more.

Regards, William

GromNaN commented 13 years ago

My concern was to use propel in a silex app (but i'm not sure its a good idea). I realize that it's already possible to use the Form classes adding the bundle to my project.

The bridge should be in a new repository like any independent lib. This lib is added to a list of dependencies in the README file.

Thus, it's not absolutely necessary to split the code. It would make form features more obvious to have a seperated component.

willdurand commented 13 years ago

To be discussed. Don't close this issue, I'm thinking of it :)

fabpot commented 13 years ago

I think it only makes sense if the bridge part is merge into symfony/symfony. If not, it makes things more complicated for no real benefit.

willdurand commented 13 years ago

Sure, but you're the only one with the symfony keys :) If you are ok to add some Propel logic in symfony/symfony, I'll work on it to create a kind of Propel bridge.

fabpot commented 13 years ago

I have no problem adding a Propel bridge to the Symfony repo BUT it should be maintained.

willdurand commented 13 years ago

To maintain a Propel bridge is not a problem as the Propel future will widely follow the Symfony2 future.

BTW, I can prepare a PR to add a bridge with the following parts:

DataCollector/
|-- PropelDataCollector.php
`-- Query.php

Form/
|-- ChoiceList
|   `-- ModelChoiceList.php
|-- DataTransformer
|   |-- ModelToIdTransformer.php
|   `-- ModelsToArrayTransformer.php
|-- EventListener
|   `-- MergeCollectionListener.php
`-- Type
    `-- ModelType.php

Logger/
`-- PropelLogger.php

Security/
`-- User
    `-- ModelUserProvider.php

Not sure to know what to add or not in this bridge. I based this list on the Doctrine bridge.

fabpot commented 13 years ago

I would suggest that we first have a solid code base before migrating to a Bridge (like having the type guesser for instance).

willdurand commented 13 years ago

Sure ;)

But you can give some advices to ease this future migration.

fabpot commented 13 years ago

It looks good to me.

willdurand commented 12 years ago

PR sent since a long time… We are waiting right now.