You are here

function hook_entityreference_autocreate_new_entity_alter in Entityreference Autocreate 7

Allows modules to interact with the entity that is being created.

Using this function it's also possible to support your own entities.

Parameters

object $entity: The entity object. This could also be NULL if the entity type is not known.

array $field_info: The field info of the entityreference field.

string $title: The title / name of the new entity that needs te be created.

1 invocation of hook_entityreference_autocreate_new_entity_alter()
entityreference_autocreate_new_entity in ./entityreference_autocreate.module
Create a placeholder item of the type described in the field settings.

File

./entityreference_autocreate.api.php, line 19
Hooks provided by the entityreference_autocreate module.

Code

function hook_entityreference_autocreate_new_entity_alter(&$entity, $field_info, $title) {

  // Make automatic entries owned by anonymous.
  $entity->uid = 0;
}