src/Service/NT8PropertyService.php
public function updateNodeInstancesFromData(\stdClass $data) {
    $updatedProperties = [];

    $nids = self::loadNodesFromPropref($data->propertyRef, FALSE);
    $updatedValues = self::generateUpdateArray($data, FALSE);

    if (count($nids) > 0) {
      $nodes = $this->entityTypeManager->getStorage('node')->loadMultiple($nids);

      foreach ($nodes as $node) {
        $updated = $this->updateNodeInstanceFromData($updatedValues, $node);

        if ($updated) {
          $updatedProperties[] = $data->propertyRef;
          $node->save();
        }
      }
    }

    return $updatedProperties;
  }
public function updateNodeInstancesFromData(\stdClass $data) {
    $updatedProperties = [];

    $nids = self::loadNodesFromPropref($data->propertyRef, FALSE);
    $updatedValues = self::generateUpdateArray($data, FALSE);

    if (count($nids) > 0) {
      $nodes = $this->entityTypeManager->getStorage('node')->loadMultiple($nids);

      foreach ($nodes as $node) {
        $updated = $this->updateNodeInstanceFromData($updatedValues, $node);

        if ($updated) {
          $updatedProperties[] = $data->propertyRef;
          $node->save();
        }
      }
    }

    return $updatedProperties;
  }
public function updateNodeInstancesFromData ( \ stdClass $ data ) { $ updatedProperties = [ ] ; $ nids = self :: loadNodesFromPropref ( $ data -> propertyRef , FALSE ) ; $ updatedValues = self :: generateUpdateArray ( $ data , FALSE ) ; if ( count ( $ nids ) > 0 ) { $ nodes = $ this -> entityTypeManager -> getStorage ( 'node' ) -> loadMultiple ( $ nids ) ; foreach ( $ nodes as $ node ) { $ updated = $ this -> updateNodeInstanceFromData ( $ updatedValues , $ node ) ; if ( $ updated ) { $ updatedProperties [ ] = $ data -> propertyRef ; $ node -> save ( ) ; } } } return $ updatedProperties ; }
Updates all matching nodes with data provided by the TABS api.

Example Usage:
$data = json_decode($api_property_data_response_string);
updateNodeInstancesFromData($data);

@param \stdClass $data
Property data as returned from the API.

@return array
Returns an array of all of the successfully updated properties' NIDs.

@throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
@throws \Drupal\Core\Entity\EntityStorageException
Updates all matching nodes with data provided by the TABS api .