You are here

function cacheflush_load in CacheFlush 8

Same name and namespace in other branches
  1. 7.3 modules/cacheflush_entity/cacheflush_entity.module \cacheflush_load()

Loads cacheflush entity by ID.

Parameters

mixed $id: The entity ID to be loaded.

Return value

null||\Drupal\Core\Entity\EntityInterface The entity object or NULL if there is no entity with the given ID.

Throws

\Exception Throws exception if exists.

3 calls to cacheflush_load()
CacheFlushEntityTest::testCrudFunctions in modules/cacheflush_entity/tests/Functional/CacheFlushEntityTest.php
Tests CRUD functions for cacheflush entity.
cacheflush_cron_clear_preset in modules/cacheflush_cron/cacheflush_cron.module
Cron job callback for cacheflush.
drush_cacheflush_drush_cacheflush in modules/cacheflush_drush/cacheflush_drush.drush.inc
Callback function for drush cacheflush.

File

modules/cacheflush_entity/cacheflush_entity.module, line 38
Cacheflush Entity API.

Code

function cacheflush_load($id) {
  return \Drupal::entityTypeManager()
    ->getStorage('cacheflush')
    ->load($id);
}