function realistic_dummy_content_api_entity_presave in Realistic Dummy Content 7.2
Same name and namespace in other branches
- 8.2 api/realistic_dummy_content_api.module \realistic_dummy_content_api_entity_presave()
- 8 api/realistic_dummy_content_api.module \realistic_dummy_content_api_entity_presave()
- 7 api/realistic_dummy_content_api.module \realistic_dummy_content_api_entity_presave()
- 3.x api/realistic_dummy_content_api.module \realistic_dummy_content_api_entity_presave()
Implements hook_entity_presave().
File
- api/
realistic_dummy_content_api.module, line 137 - API code allowing other modules to generate realistic dummy content.
Code
function realistic_dummy_content_api_entity_presave($entity, $type = NULL) {
try {
// In Drupal 7, $entity and $type will be populated. In Drupal 8, only
// $entity will be populated.
Framework::instance()
->hookEntityPresave($entity, $type);
} catch (Exception $e) {
drupal_set_message($e
->getMessage());
}
}