You are here

function entity_test_mulrev_load in Drupal 8

Loads a test entity.

Parameters

int $id: A test entity ID.

bool $reset: A boolean indicating that the internal cache should be reset.

Return value

\Drupal\entity_test\Entity\EntityTestMulRev The loaded entity object, or NULL if the entity cannot be loaded.

Deprecated

in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal::entityTypeManager()->getStorage('entity_test_mulrev_load')->load().

See also

https://www.drupal.org/node/2266845

File

core/modules/system/tests/modules/entity_test/entity_test.module, line 449
Test module for the entity API providing several entity types for testing.

Code

function entity_test_mulrev_load($id, $reset = FALSE) {
  @trigger_error('entity_test_mulrev_load() is deprecated in Drupal 8.0.0 and will be removed before Drupal 9.0.0. Use \\Drupal::entityTypeManager()->getStorage(\'entity_test_mulrev\')->load(). See https://www.drupal.org/node/2266845', E_USER_DEPRECATED);
  $storage = \Drupal::entityTypeManager()
    ->getStorage('entity_test_mulrev');
  if ($reset) {
    $storage
      ->resetCache([
      $id,
    ]);
  }
  return $storage
    ->load($id);
}