public function saveInto(\DataObjectInterface $record) { if ($this->name) { $castingHelper = $record->castingHelper($this->name); if ($castingHelper == 'Boolean') { $record->setCastedField($this->name, $this->getBooleanValue()); } else { $record->setCastedField($this->name, $this->dataValue()); } } }