function entity_load

Loads an entity from the database.

Parameters

string $entity_type: The entity type to load, e.g. node or user.

int $id: The id of the entity to load.

bool $reset: Whether to reset the internal cache for the requested entity type.

Return value

Drupal\Core\Entity\EntityInterface The entity object, or FALSE if there is no entity with the given id.

See also

\Drupal\Core\Entity\EntityManager

entity_load_multiple()

Drupal\Core\Entity\EntityStorageControllerInterface

Drupal\Core\Entity\DatabaseStorageController

Drupal\Core\Entity\Query\QueryInterface

55 calls to entity_load()
BreakpointGroup::addBreakpointFromMediaQuery in drupal/core/modules/breakpoint/lib/Drupal/breakpoint/Plugin/Core/Entity/BreakpointGroup.php
Adds a breakpoint using a name and a media query.
BreakpointGroup::addBreakpoints in drupal/core/modules/breakpoint/lib/Drupal/breakpoint/Plugin/Core/Entity/BreakpointGroup.php
Adds one or more breakpoints to this group.
BreakpointGroupCRUDTest::testBreakpointGroupCRUD in drupal/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointGroupCRUDTest.php
Test CRUD operations for breakpoint groups.
BreakpointGroupTestBase::verifyBreakpointGroup in drupal/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointGroupTestBase.php
Verify that a breakpoint is properly stored.
BreakpointThemeTest::testThemeBreakpointGroup in drupal/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointThemeTest.php
Test the breakpoints defined by the custom group.

... See full list

File

drupal/core/includes/entity.inc, line 90
Entity API for handling entities like nodes or users.

Code

function entity_load($entity_type, $id, $reset = FALSE) {
  $entities = entity_load_multiple($entity_type, array(
    $id,
  ), $reset);
  return isset($entities[$id]) ? $entities[$id] : FALSE;
}