You are here

public static function ContentEntitySource::load in Translation Management Tool 8

Loads a single entity for the given entity type ID.

By providing the language code, the latest revisions affecting the specified translation (language code) will be returned.

Parameters

string $entity_type_id: The entity type ID.

string $id: The entity ID.

string|null $langcode: (optional) The language code. Defaults to source entity language.

Return value

\Drupal\Core\Entity\ContentEntityInterface|null The loaded entity or null if not found.

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

9 calls to ContentEntitySource::load()
ContentEntitySource::getData in sources/content/src/Plugin/tmgmt/Source/ContentEntitySource.php
Implements TMGMTEntitySourcePluginController::getData().
ContentEntitySource::getLabel in sources/content/src/Plugin/tmgmt/Source/ContentEntitySource.php
Return a title for this job item.
ContentEntitySource::getPendingRevisionWithCompositeReferenceField in sources/content/src/Plugin/tmgmt/Source/ContentEntitySource.php
Returns the source revision if it is a pending revision with an ERR field.
ContentEntitySource::getUrl in sources/content/src/Plugin/tmgmt/Source/ContentEntitySource.php
Returns the Uri for this job item.
ContentEntitySource::shouldCreateContinuousItem in sources/content/src/Plugin/tmgmt/Source/ContentEntitySource.php
Checks whether the continuous job item should be created.

... See full list

File

sources/content/src/Plugin/tmgmt/Source/ContentEntitySource.php, line 120

Class

ContentEntitySource
Content entity source plugin controller.

Namespace

Drupal\tmgmt_content\Plugin\tmgmt\Source

Code

public static function load($entity_type_id, $id, $langcode = NULL) {
  $entities = static::loadMultiple($entity_type_id, [
    $id,
  ], $langcode);
  return isset($entities[$id]) ? $entities[$id] : NULL;
}