I am developing my application with cakephp 2.4.6. i know there are lots of posts in the stackoverflow related to saveAssociated issue.I have implemented several HABTM relationship in my database and now i am struggling a lot because of its unexpected behaviour. I have
Model Details
TEmployeeProfile HABTM TAddress
TEmPloyeeProfile HABTM TUserGroup
my table names are
employee_profiles , t_addresses,t_addresses_employee_profiles,
t_user_groups,employee_profiles_t_user_groups
And my $this->request->data contain
array(
'EmployeeProfile' => array(
'first_name' => 'Emppppp',
'last_name' => 'kjljj',
't_login_id' => '222'
),
'TUserGroup' => array(
(int) 0 => '9',
(int) 1 => '13'
),
'TAddress' => array(
(int) 0 => array(
'number_street' => 'emmmm',
'area' => '545454',
'state' => '2',
'city' => '3',
),
(int) 1 => array(
'number_street' => 'empppppp',
'area' => 'nkjk',
'state' => '2',
'city' => '3',
)
)
)
NOW When i try to save using
$this->EmployeeProfile->saveAssociated($this->request->data)
it will save only EmployeeProfile and TUserGroup Details
Ans When i try t save using
$this->EmployeeProfile->saveALl($this->request->data)
it will save only EmployeeProfile Details..
Whats Wrong With me.. i am stucking everywhere... because every whhere i am using this like relationship . if i can solve this then only i can do the remaining sections. please help me... i have Posted my whole code here COMPLETE CODE