You are here

function realistic_dummy_content_api_is_dummy in Realistic Dummy Content 3.x

Same name and namespace in other branches
  1. 8.2 api/realistic_dummy_content_api.module \realistic_dummy_content_api_is_dummy()
  2. 8 api/realistic_dummy_content_api.module \realistic_dummy_content_api_is_dummy()
  3. 7.2 api/realistic_dummy_content_api.module \realistic_dummy_content_api_is_dummy()
  4. 7 api/realistic_dummy_content_api.module \realistic_dummy_content_api_is_dummy()

Checks if a given entity is dummy content.


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

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

Return value

bool 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 realistic_dummy_content_api_is_dummy()
Drupal8::hookEntityPresave in api/src/Framework/Drupal8.php
React to an entity just before it is saved.
Framework::testModuleInvokeAll in api/src/Framework/Framework.php
Tests self::moduleInvokeAll().


api/realistic_dummy_content_api.module, line 169
API code allowing other modules to generate realistic dummy content.


function realistic_dummy_content_api_is_dummy($entity, $type) {
  foreach (Framework::instance()
    ->moduleInvokeAll('realistic_dummy_content_api_dummy', $entity, $type) as $dummy) {
    if ($dummy) {
      return TRUE;
  return FALSE;