If I have a 1->many relationship in my db, and want to show some part of the “many” in an update form, what’s the best way to allow editing of individual items of the “many”?
For example, a person can have many email addresses. I would like to show the person’s basic details (name, etc.) and all their email addresses, each of which should be editable. Given this:
public function relations()
{
return array(
'emails' => array(self::HAS_MANY, 'Email', 'person_id'),
/* etc. */
);
}
I can get hold of the addresses easily enough, but only as a bunch. Normally I’d pass that data to a list control of some kind, but then (as far as I know) the users can’t edit each individual address.