public static function setSendUserSettings($destination, $account, $values) {
    if (is_object($account) && !empty($values)) {
      foreach ($values as $message_template => $frequency) {
        $query = \Drupal::database()->merge('user_activity_send');
        $query->fields([
          'uid' => $account->id(),
          'destination' => $destination,
          'message_template' => $message_template,
          'frequency' => $frequency,
        ]);
        $query->keys([
          'uid' => $account->id(),
          'destination' => $destination,
          'message_template' => $message_template,
        ]);
        $query->execute();
      }
    }
  }
public static function setSendUserSettings($destination, $account, $values) {
    if (is_object($account) && !empty($values)) {
      foreach ($values as $message_template => $frequency) {
        $query = \Drupal::database()->merge('user_activity_send');
        $query->fields([
          'uid' => $account->id(),
          'destination' => $destination,
          'message_template' => $message_template,
          'frequency' => $frequency,
        ]);
        $query->keys([
          'uid' => $account->id(),
          'destination' => $destination,
          'message_template' => $message_template,
        ]);
        $query->execute();
      }
    }
  }
public static function setSendUserSettings ( $ destination , $ account , $ values ) { if ( is_object ( $ account ) && ! empty ( $ values ) ) { foreach ( $ values as $ message_template => $ frequency ) { $ query = \ Drupal :: database ( ) -> merge ( 'user_activity_send' ) ; $ query -> fields ( [ 'uid' => $ account -> id ( ) , 'destination' => $ destination , 'message_template' => $ message_template , 'frequency' => $ frequency , ] ) ; $ query -> keys ( [ 'uid' => $ account -> id ( ) , 'destination' => $ destination , 'message_template' => $ message_template , ] ) ; $ query -> execute ( ) ; } } }
Set notification settings for given user.
Set notification settings for given user .