You are here

public static function MappingLoader::load in GatherContent 8.5

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

Cache mappings when loading them.

2 calls to MappingLoader::load()
ContentImportSelectForm::submitForm in gathercontent_ui/src/Form/ContentImportSelectForm.php
Form submission handler.
GatherContentUploadTestBase::getMapping in gathercontent_upload/tests/src/Kernel/GatherContentUploadTestBase.php
Returns mapping for a GatherContent Item.

File

src/MappingLoader.php, line 23

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];
}