You are here

function realistic_dummy_content_api_validate 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_validate()
  2. 8 api/realistic_dummy_content_api.module \realistic_dummy_content_api_validate()
  3. 7.2 api/realistic_dummy_content_api.module \realistic_dummy_content_api_validate()
  4. 7 api/realistic_dummy_content_api.module \realistic_dummy_content_api_validate()

Throw an exception if an entity is not valid.

1 call to realistic_dummy_content_api_validate()
Drupal8::hookEntityPresave in api/src/Framework/Drupal8.php
React to an entity just before it is saved.

File

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

Code

function realistic_dummy_content_api_validate($entity, $type) {

  // Throw an exception here if an entity is not valid, for example if two users
  // have the same email address or name, or anything else.
  // @TODO provide a hook for third-party modules to manage this.
}