* http://www.yiiframew...nsion/relation/ a widget to update related tables
* http://www.yiiframew...ncedarbehavior/ a behavior to do same thing
Now I'd prefer to use a component behavior, but CAdvancedArBehavior has only MANY_MANY capability, it doesn't work with BELONGS_TO and HAS_ONE, as widget do. Further more, the widget seems a cleaner code.
So I would like to write a behavior taking code from the widget. Now my questions:
1. Does exist a component behavior that makes those update?
2. After I've created a behavior and attached to my Active model with:
public function behaviors(){ return array( 'MyBehavior' => array( 'class' => 'path.to.MyBehavior')); }
How can I access to Behavior's methods from Controller? I've tried $this->MyBehavior->method() but it does nothing
3. If I create a method that exists in model where behavior is attached, for example save() method, it overwrites model's one?