public function updateGauge()

in modules/quanthub_sdmx_sync/src/QuanthubSdmxSyncGauges.php [142:155]


  public function updateGauge(int $nid, string $period, string $value) {
    $entity = $this->entityTypeManager->getStorage('node')->load($nid);

    if (
      (!empty($value) && $entity->field_gauge_value->getString() != $value) ||
      (!empty($period) && $entity->field_gauge_period->getString() != $period)
    ) {
      $entity
        ->set('field_gauge_period', $period)
        ->set('field_gauge_value', $value)
        ->setSyncing(TRUE)
        ->save();
    }
  }