You are here

protected function FeedStorage::denormalize in MongoDB 8

Parameters

array $translated_values:

Return value

array

Overrides ContentEntityStorage::denormalize

File

mongodb_aggregator/src/Entity/FeedStorage.php, line 31
Contains Drupal\mongodb\Entity\FeedStorageController.

Class

FeedStorage

Namespace

Drupal\mongodb_aggregator\Entity

Code

protected function denormalize(array $translated_values) {
  $checked_plus_refresh = 0;
  foreach (array(
    'checked',
    'refresh',
  ) as $field) {
    if (!empty($translated_values[$field][0]['value'])) {
      $checked_plus_refresh += $translated_values[$field][0]['value'];
    }
  }
  $translated_values['checked_plus_refresh'][0]['value'] = $checked_plus_refresh;
  return parent::denormalize($translated_values);
}