| sfPropelActAsPolymorphicBehaviorPlugin ALPHA [message #35493] |
Thu, 13 September 2007 14:14  |
kriswallsmith Messages: 43 Registered: September 2007 Location: Portland, Oregon USA |
Member |
|
|
Hi all,
I just posted a wiki page for a plugin I've been working on:
sfPropelActAsPolymorphicBehaviorPlugin
Please take a look and post comments/feedback/criticism here.
Thanks a bunch,
Kris Wallsmith
[Updated on: Thu, 13 September 2007 14:16]
|
|
|
|
|
|
| Re: sfPropelActAsPolymorphicBehaviorPlugin ALPHA [message #41812 is a reply to message #35493 ] |
Sun, 16 December 2007 19:51  |
rupher Messages: 7 Registered: December 2007 |
Junior Member |
|
|
I looked at the code of the plugin and noticed that it expects foreign_pk not foreign_id.
I changed my code to
$hasManyKeys = array('comments' => array('foreign_model' => CommentPeer::SUBJECT_TYPE, 'foreign_pk' => CommentPeer::SUBJECT_ID));
sfPropelBehavior::add('Post', array('sfPropelActAsPolymorphic' => array('has_many' => $hasManyKeys)));
sfPropelActAsPolymorphicBehavior::mixinCustomMethods('Post');
From the comment object, can I get the object related to it?
|
|
|