protected function SavedSearchType::writeChangesToSettings in Search API Saved Searches 8
Prepares for changes to this saved search type to be persisted.
To this end, the settings for all loaded notification plugin objects are written back to the $notification_settings property.
Return value
$this
2 calls to SavedSearchType::writeChangesToSettings()
- SavedSearchType::preSave in src/
Entity/ SavedSearchType.php - Acts on an entity before the presave hook is invoked.
- SavedSearchType::__sleep in src/
Entity/ SavedSearchType.php - Implements the magic __sleep() method.
File
- src/
Entity/ SavedSearchType.php, line 151
Class
- SavedSearchType
- Provides an entity type for configuring how searches can be saved.
Namespace
Drupal\search_api_saved_searches\EntityCode
protected function writeChangesToSettings() {
// We only need to re-write the $notification_settings property if the
// plugins were loaded.
if ($this->notificationPluginInstances !== NULL) {
$this->notification_settings = [];
foreach ($this->notificationPluginInstances as $plugin_id => $plugin) {
$this->notification_settings[$plugin_id] = $plugin
->getConfiguration();
}
}
return $this;
}