_getDefaultValues(); $currentValue = $this->getValue(); if (!$currentValue) { $replaceValue = isset($data[$this->getField()]) ? $data[$this->getField()] : false; $this->setValue($replaceValue); } return $this; } /** * Get Default Config Values * * @return array */ protected function _getDefaultValues() { if (!$this->defaultValues) { $this->defaultValues = $this->_config->getValue('system/full_page_cache/default'); } return $this->defaultValues; } /** * If fields are empty fill them with default data * * @return $this|\Magento\Framework\Model\AbstractModel */ protected function _afterLoad() { $data = $this->_getDefaultValues(); $currentValue = $this->getValue(); if (!$currentValue) { foreach ($data as $field => $value) { if (strstr($this->getPath(), $field)) { $this->setValue($value); $this->save(); break; } } } return $this; } }