function realistic_dummy_content_api_is_dummy in Realistic Dummy Content 8.2
Same name and namespace in other branches
- 8 api/realistic_dummy_content_api.module \realistic_dummy_content_api_is_dummy()
- 7.2 api/realistic_dummy_content_api.module \realistic_dummy_content_api_is_dummy()
- 7 api/realistic_dummy_content_api.module \realistic_dummy_content_api_is_dummy()
- 3.x api/realistic_dummy_content_api.module \realistic_dummy_content_api_is_dummy()
Checks if a given entity is dummy content.
Parameters
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.
4 calls to realistic_dummy_content_api_is_dummy()
- Drupal7::genericEntityPresave in api/
src/ Framework/ Drupal7.php - Generic function called by various hooks in Drupal.
- Drupal8::hookEntityPresave in api/
src/ Framework/ Drupal8.php - Framework::testModuleInvokeAll in api/
src/ Framework/ Framework.php - Tests self::moduleInvokeAll().
- Mock::hookEntityPresave in api/
src/ Framework/ Mock.php
File
- api/
realistic_dummy_content_api.module, line 222 - API code allowing other modules to generate realistic dummy content.
Code
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;
}