Hi Kiril, Kiril Angov schrieb: > Hello, > > here are several issues I encountered while trying to work on a Propel > behavior. > > 1) Why do we have the mixins only on certain Peer methods (for example > we cannot make a behavior on doCount() or any of the count methods). > Is there a reason the rest are not supported or it was just overlooked > at that time. I am asking because I added the mixins for doCount*() > and I can modify successfully use Propel behavior on it.
Don't really know why, but I've missed them as well. There are new Peer Mixins in Symfony 1.1 at least for the doSelectJoin*() methods but I don't know if this concerns methods like doCount*() as well. > > 2) This was a little tricky to find but here is what I noticed. When > we have behaviors, we usually define them in the model class, at the > end of it. And in my situation I have a problem because when I call a > static method like CollectionPeer::doSelectJoinCollector($c), the > symfony autoloading is loading CollectionPeer.php which in turns calls > the sfPropelBehavior::add() but the function was already executed! > Which means that the first ever method that I call from CollectionPeer > class will not be executed after the Propel behavior is being added > but before that. This is some really strange but it seems like the > CollectionPeer::doSelectJoinCollector($c) call is executed first > before anything in CollectionPeer.php file. > > I hope I explained well the problem but this is causing unexpected > behavior when your very first call to the Peer object depends on the > Propel behavior to be loaded. So as a solution I moved the > sfPropelBehavior::add() calls to the config.php file where I defined > the hooks and this makes sure the behavior is loaded before any calls > to the model classes but we should either make that clear somewhere or > if possible find a solution to this. Not a solution to the problem per se, but I went the same route as you did (defining behaviors in the config.php) which led to same problems using peer constants. Instead I'm now defining behaviors in my schema using the sfPropelAlternativeSchemaPlugin which works just fine. > > Thanks, > Kiril > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-devs?hl=en -~----------~----~----~----~------~----~------~--~---
