You are here

function hook_profile2_type_insert in Profile 2 7.2

Same name and namespace in other branches
  1. 7 profile2.api.php \hook_profile2_type_insert()

Respond when a profile type is inserted.

This hook is invoked after the profile type is inserted into the database.

Parameters

$type: The profile type that is being inserted.

2 functions implement hook_profile2_type_insert()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

profile2_i18n_profile2_type_insert in contrib/profile2_i18n.module
Implements hook_profile2_type_insert().
profile2_profile2_type_insert in ./profile2.module
Implements hook_profile2_type_insert().

File

./profile2.api.php, line 175
This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.

Code

function hook_profile2_type_insert($type) {
  db_insert('mytable')
    ->fields(array(
    'id' => $type->id,
    'extra' => $type->extra,
  ))
    ->execute();
}