You are here

protected function DisabledDefaultTags::loadMetatagDefault in Metatag 8

Load a default metatag.

Parameters

string $id: The id of the metatag default to load.

Return value

\Drupal\Core\Entity\EntityInterface|null The default metatag.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

3 calls to DisabledDefaultTags::loadMetatagDefault()
DisabledDefaultTags::test403 in tests/src/Functional/DisabledDefaultTags.php
Test that a disabled 403 metatag default doesn't load.
DisabledDefaultTags::test404 in tests/src/Functional/DisabledDefaultTags.php
Test that a disabled 404 metatag default doesn't load.
DisabledDefaultTags::testFrontpage in tests/src/Functional/DisabledDefaultTags.php
Test that a disabled Frontpage metatag default doesn't load.

File

tests/src/Functional/DisabledDefaultTags.php, line 70

Class

DisabledDefaultTags
Verify that disabled metatag defaults do not load.

Namespace

Drupal\Tests\metatag\Functional

Code

protected function loadMetatagDefault($id) {

  /** @var \Drupal\Core\Entity\EntityStorageInterface $global_metatag_manager */
  $global_metatag_manager = \Drupal::entityTypeManager()
    ->getStorage('metatag_defaults');

  /** @var \Drupal\metatag\Entity\MetatagDefaults $entity_metatags */
  return $global_metatag_manager
    ->load($id);
}