getFieldName(), $field->getLabel(), BedrockUtil::map($field->getMap())); } function saveInto(DataObject $record) { $fieldname = $this->name ; if($fieldname && $record && ($record->has_many($fieldname) || $record->many_many($fieldname) || $record->belongs_many_many($fieldname))) { $idList = array(); if($this->value) foreach($this->value as $id => $bool) { if($bool) { $idList[] = $id; } } $record->$fieldname()->setByIDList($idList); } elseif($fieldname && $record) { if($this->value) { $this->value = str_replace(',', '{comma}', $this->value); $record->$fieldname = implode(",", $this->value); } else { $record->$fieldname = ''; } } } }