You are here

function hook_profile2_insert in Profile 2 7

Same name and namespace in other branches
  1. 7.2 profile2.api.php \hook_profile2_insert()

Respond when a profile is inserted.

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

Parameters

profile: The profile that is being inserted.

See also

hook_entity_insert()

File

./profile2.api.php, line 43
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_insert($profile) {
  db_insert('mytable')
    ->fields(array(
    'pid' => $profile->pid,
    'extra' => $profile->extra,
  ))
    ->execute();
}