Code Duplication    Length = 8-8 lines in 2 locations

forms/CheckboxSetField.php 1 location

@@ 222-229 (lines=8) @@
219
				}
220
			}
221
			$relation->setByIDList($idList);
222
		} elseif($fieldname && $record) {
223
			if($this->value) {
224
				$this->value = str_replace(',', '{comma}', $this->value);
225
				$record->$fieldname = implode(',', (array) $this->value);
226
			} else {
227
				$record->$fieldname = '';
228
			}
229
		}
230
	}
231
232
	/**

forms/ListboxField.php 1 location

@@ 192-199 (lines=8) @@
189
						: null;
190
				}
191
				$relation->setByIDList($idList);
192
			} elseif($fieldname && $record) {
193
				if($this->value) {
194
					$this->value = str_replace(',', '{comma}', $this->value);
195
					$record->$fieldname = implode(",", $this->value);
196
				} else {
197
					$record->$fieldname = null;
198
				}
199
			}
200
		} else {
201
			parent::saveInto($record);
202
		}