Changeset 57099
- Timestamp:
- 30/06/08 14:55:51 (2 months ago)
- Files:
-
- 1 modified
-
modules/sapphire/trunk/forms/CheckboxSetField.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
modules/sapphire/trunk/forms/CheckboxSetField.php
r56219 r57099 107 107 108 108 /** 109 * @desc 110 */ 109 * Save the current value of this CheckboxSetField into a DataObject. 110 * If the field it is saving to is a has_many or many_many relationship, 111 * it is saved by setByIDList(), otherwise it creates a comma separated 112 * list for a standard DB text/varchar field. 113 * 114 * @param DataObject $record The record to save into 115 */ 111 116 function saveInto(DataObject $record) { 112 117 $fieldname = $this->name ; … … 114 119 if($fieldname && $record && ($record->has_many($fieldname) || $record->many_many($fieldname))) { 115 120 $record->$fieldname()->setByIDList($this->value); 116 } else if($fieldname && $record && $record->hasField($fieldname)) {117 if($this->value) {121 } elseif($fieldname && $record) { 122 if($this->value) { 118 123 $this->value = str_replace(",", "{comma}", $this->value); 119 124 $record->$fieldname = implode(",", $this->value);
