public function saveInto(DataObjectInterface $record) { if ($record->hasField($this->name) && $record->escapeTypeForField($this->name) != 'xml') { throw new Exception('HTMLEditorField->saveInto(): This field should save into a HTMLText or HTMLVarchar field.'); } // Sanitise if requested $htmlValue = Injector::inst()->create('HTMLValue', $this->Value()); if ($this->config()->sanitise_server_side) { $santiser = Injector::inst()->create('HTMLEditorSanitiser', HTMLEditorConfig::get_active()); $santiser->sanitise($htmlValue); } // optionally manipulate the HTML after a TinyMCE edit and prior to a save $this->extend('processHTML', $htmlValue); // Store into record $record->{$this->name} = $htmlValue->getContent(); }