You are here

static function RealisticDummyContent::is_dummy in Realistic Dummy Content 8

Checks if a given entity is dummy content.

Parameters

$entity: The object for a given entity type, for example this can be a user object or a node object.

$type: The type of the information to change, for example 'user' or 'node'.

Return value

TRUE if at least one module implemented hook_realistic_dummy_content_api_dummy and thinks the entity is a dummy objects; FALSE otherwise.

2 calls to RealisticDummyContent::is_dummy()
RealisticDummyContent::entity_presave in api/src/facade/RealisticDummyContent.php
Implements hook_entity_insert().
realistic_dummy_content_api_is_dummy in api/realistic_dummy_content_api.module
Checks if a given entity is dummy content.

File

api/src/facade/RealisticDummyContent.php, line 85
Define autoload class.

Class

RealisticDummyContent

Namespace

Drupal\realistic_dummy_content_api\facade

Code

static function is_dummy($entity, $type) {
  foreach (\Drupal::moduleHandler()
    ->invokeAll('realistic_dummy_content_api_dummy', array(
    $entity,
    $type,
  )) as $dummy) {
    if ($dummy) {
      return TRUE;
    }
  }
  return FALSE;
}