Has_Many Relation Via Through: $Model->Save();

Hi all,

I’m looking for some help with a problem I am experiencing.

What I have is a HAS_MANY relationship with a model that represents a MANY_MANY relationship.

Model Code:

	public function relations()


		// NOTE: you may need to adjust the relation name and the related

		// class name for the relations automatically generated below.

		return array(

			'positionFieldgroups' => array(self::HAS_MANY, 'PositionFieldgroup', 'position_id'),

			'fieldgroups' => array(self::HAS_MANY, 'Fieldgroup', 'fieldgroup_id', 'through' => 'positionFieldgroups'),



Now I’m looking for a way to save the related fieldgroups parameter. I’ve tried the ESaveRelatedBehavior and CAdvancedArBehavior components without luck.

Any suggestions?