You are here

function Common::nodeContentLoad in Filebrowser 3.x

Same name and namespace in other branches
  1. 8.2 src/Services/Common.php \Drupal\filebrowser\Services\Common::nodeContentLoad()

Load a specific node content.

Parameters

int $fid content fid:

Return value

mixed record

File

src/Services/Common.php, line 202

Class

Common
Class Common @package Drupal\filebrowser\Services

Namespace

Drupal\filebrowser\Services

Code

function nodeContentLoad($fid) {

  // todo: combine with nodeContentLoadMultiple
  static $contents = [];
  if (isset($contents[$fid])) {
    return $contents[$fid];
  }
  $contents[$fid] = $this->storage
    ->loadRecord($fid);
  if ($contents[$fid]) {
    return $contents[$fid];
  }
  else {
    return FALSE;
  }
}