[eluser]johnmerlino[/eluser]
This does exactly what I want to happen:
Code:
$zones = $this->input->post('zones');
foreach($zones as $z){
switch($z){
case 'main':
$a = new Zone();
$a->where('name',$z)->get();
$subcategory->save($a);
break;
case 'panel':
$b = new Zone();
$b->where('name',$z)->get();
$subcategory->save($b);
break;
}
}
$subcategory->save(
array(
'related_category' => $parent_category
)
);
But as you can see, it doesn't look nice that I have to call save three times. I'm sure there's a better way.
Thanks for response.