You are here

function ContentExportController::getNodeData in Content Export CSV 8

* Gets Manipulated Node Data

1 call to ContentExportController::getNodeData()
ContentExportController::getNodeDataList in src/Controller/ContentExportController.php
* Collects Node Data

File

src/Controller/ContentExportController.php, line 61

Class

ContentExportController

Namespace

Drupal\content_export_csv\Controller

Code

function getNodeData($nodeObject, $nodeType) {
  $nodeData = array();
  $nodeFields = self::getValidFieldList($nodeType);
  foreach ($nodeFields as $nodeField) {
    $nodeData[] = isset($nodeObject->{$nodeField}->value) ? '"' . htmlspecialchars(strip_tags($nodeObject->{$nodeField}->value)) . '"' : (isset($nodeObject->{$nodeField}->target_id) ? '"' . htmlspecialchars(strip_tags($nodeObject->{$nodeField}->target_id)) . '"' : '"' . htmlspecialchars(strip_tags($nodeObject->{$nodeField}->langcode)) . '"');
  }
  return $nodeData;
}