/** * Save all the items in this list into the RelationList * * @param RelationList $list */ public function changeToList(RelationList $list) { foreach ($this->items as $key => $item) { if (is_object($item)) { $item->write(); } $list->add($item, $this->extraFields[$key]); } }