I'm working on a project which requires quite a lot of pieces which will be used in various combinations on different installations. I'd like to break these down into bundles, but I'm stuck on how to deal with the entity extensions. Without doctrine this is very simple: add new columns or tables to the database.
Example: ForumBundle/Entity/Topic I want to add ForumTaggingBundle/Entity/Tag and ForumVotingBundle/Entity/Vote. Both have bi-directional relationships with the Topic entity. However, the Topic entity is more or less read only (let's assume it's a vendor file)
Without digging too much I assume this is possible at the mapping level (perhaps with a little custom code). However, I'm not sure how to handle the entities themselves yet. I don't want to extend it because I can only do that once. Any suggestions on how I can solve this? I have a few unvalidated ideas, but I'd like some feedback on which is the most viable.
- Magic (__call) ? :( - Generated file before proxy generation? - Built in field as an extension point?
Any help would be appreciated. I'd like to leave options open between ORM/ODM, so something that doesn't break the abstraction would be super.
> I'm working on a project which requires quite a lot of pieces which will be
> used in various combinations on different installations. I'd like to break
> these down into bundles, but I'm stuck on how to deal with the entity
> extensions. Without doctrine this is very simple: add new columns or tables
> to the database.
> Example: ForumBundle/Entity/Topic
> I want to add ForumTaggingBundle/Entity/Tag and
> ForumVotingBundle/Entity/Vote. Both have bi-directional relationships with
> the Topic entity. However, the Topic entity is more or less read only
> (let's assume it's a vendor file)
> Without digging too much I assume this is possible at the mapping level
> (perhaps with a little custom code). However, I'm not sure how to handle
> the entities themselves yet. I don't want to extend it because I can only
> do that once. Any suggestions on how I can solve this? I have a few
> unvalidated ideas, but I'd like some feedback on which is the most viable.
> - Magic (__call) ? :(
> - Generated file before proxy generation?
> - Built in field as an extension point?
> Any help would be appreciated. I'd like to leave options open between
> ORM/ODM, so something that doesn't break the abstraction would be super.
> --
> If you want to report a vulnerability issue on symfony, please send it to
> security at symfony-project.com
> You received this message because you are subscribed to the Google
> Groups "Symfony2" group.
> To post to this group, send email to symfony2@googlegroups.com
> To unsubscribe from this group, send email to
> symfony2+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/symfony2?hl=en
I've been looking at that this morning. It looks like the other viable option I've forgotten is to use the mappedSuperClass, and have users copy/paste the additional fields / mapping information into the (now required) application-space extended bundle.
Acme\ForumBundle\Entity\Forum would require adding the addTag(), removeTag(), etc. fields, and then the ForumTaggingBundle could supply a Taggable interface so we can still have some clean code organization. I'm a little confused on how to properly apply the relationship mapping this way, but it looks like it'll work.
It would have been handy if there was an extension point in the ProxyFactory so I can generate entities before proxies are created.
> 2012/10/5 Adrian Schneider <sira...@gmail.com <javascript:>>: > > I'm working on a project which requires quite a lot of pieces which will > be > > used in various combinations on different installations. I'd like to > break > > these down into bundles, but I'm stuck on how to deal with the entity > > extensions. Without doctrine this is very simple: add new columns or > tables > > to the database.
> > Example: ForumBundle/Entity/Topic > > I want to add ForumTaggingBundle/Entity/Tag and > > ForumVotingBundle/Entity/Vote. Both have bi-directional relationships > with > > the Topic entity. However, the Topic entity is more or less read only > > (let's assume it's a vendor file)
> > Without digging too much I assume this is possible at the mapping level > > (perhaps with a little custom code). However, I'm not sure how to > handle > > the entities themselves yet. I don't want to extend it because I can > only > > do that once. Any suggestions on how I can solve this? I have a few > > unvalidated ideas, but I'd like some feedback on which is the most > viable.
> > - Magic (__call) ? :( > > - Generated file before proxy generation? > > - Built in field as an extension point?
> > Any help would be appreciated. I'd like to leave options open between > > ORM/ODM, so something that doesn't break the abstraction would be super.
> > -- > > If you want to report a vulnerability issue on symfony, please send it > to > > security at symfony-project.com
> > You received this message because you are subscribed to the Google > > Groups "Symfony2" group. > > To post to this group, send email to symf...@googlegroups.com<javascript:> > > To unsubscribe from this group, send email to > > symfony2+u...@googlegroups.com <javascript:> > > For more options, visit this group at > > http://groups.google.com/group/symfony2?hl=en
I am new in symfony2.1. I am using wamp server (apache 2.2.22 and php 5.3.13). I have configured everything properly for symfony2.1. but problem happen when I am trying to retrieve data from database . Sometimes its work properly but sometime it doesn’t work. Than I have to restart the server.
To solve that I have installed apache, php and mysql separately. But still I am facing the same problem.
On Friday, October 5, 2012 9:26:30 AM UTC+1, Adrian Schneider wrote:
> I'm working on a project which requires quite a lot of pieces which will > be used in various combinations on different installations. I'd like to > break these down into bundles, but I'm stuck on how to deal with the entity > extensions. Without doctrine this is very simple: add new columns or > tables to the database.
> Example: ForumBundle/Entity/Topic
> I want to add ForumTaggingBundle/Entity/Tag and > ForumVotingBundle/Entity/Vote. Both have bi-directional relationships with > the Topic entity. However, the Topic entity is more or less read only > (let's assume it's a vendor file)
> Without digging too much I assume this is possible at the mapping level > (perhaps with a little custom code). However, I'm not sure how to handle > the entities themselves yet. I don't want to extend it because I can only > do that once. Any suggestions on how I can solve this? I have a few > unvalidated ideas, but I'd like some feedback on which is the most viable.
> - Magic (__call) ? :(
> - Generated file before proxy generation?
> - Built in field as an extension point?
> Any help would be appreciated. I'd like to leave options open between > ORM/ODM, so something that doesn't break the abstraction would be super.