You are here

public static function MappingLoader::load in GatherContent 8.4

Same name and namespace in other branches
  1. 8.5 src/MappingLoader.php \Drupal\gathercontent\MappingLoader::load()

Cache mappings when loading them.

2 calls to MappingLoader::load()
ContentProcessor::createNode in src/Import/ContentProcess/ContentProcessor.php
Create a Drupal node filled with the properties of the GC item.
ContentProcessorTest::assertNodeEqualsGcItem in tests/src/Kernel/ContentProcessorTest.php
Checks whether a node and a GC item contains the same data.

File

src/MappingLoader.php, line 18

Class

MappingLoader
A static class to return and cache mapping entities.

Namespace

Drupal\gathercontent

Code

public static function load(Item $gcItem) {
  if (!isset(static::$mappings[$gcItem->id])) {
    static::$mappings[$gcItem->id] = static::getMapping($gcItem);
  }
  return static::$mappings[$gcItem->id];
}