ExpressionEngine® User Guide

Legacy Documentation

You are using the documentation for version 4.3.8. Go here for the latest version.

Member Model Extension Hooks

before_member_insert

before_member_insert($member, $values)

Called before the member object is inserted. Changes made to the object will be saved automatically.

How it’s called:

ee()->extensions->call('before_member_insert', $this, $this->getValues());
Parameters:
  • $member (object) – Current Member model object
  • $values (array) – The Member model object data as an array
Returns:

void

Return type:

NULL

New in version 3.1.0.

after_member_insert

after_member_insert($member, $values)

Called after the member object is inserted. Changes made to the object object will not be saved automatically. Saving the object may trigger the save and update hooks.

How it’s called:

ee()->extensions->call('after_member_insert', $this, $this->getValues());
Parameters:
  • $member (object) – Current Member model object
  • $values (array) – The Member model object data as an array
Returns:

void

Return type:

NULL

New in version 3.1.0.

before_member_update

before_member_update($member, $values, $modified)

Called before the member object is updated. Changes made to the object will be saved automatically.

How it’s called:

ee()->extensions->call('before_member_update', $this, $this->getValues(), $modified);
Parameters:
  • $member (object) – Current Member model object
  • $values (array) – The Member model object data as an array
  • $modified (array) – An array of all the old values that were changed
Returns:

void

Return type:

NULL

New in version 3.1.0.

after_member_update

after_member_update($member, $values, $modified)

Called after the member object is updated. Changes made to the object will not be saved automatically. Calling save may fire additional hooks.

How it’s called:

ee()->extensions->call('after_member_update', $this, $this->getValues(), $modified);
Parameters:
  • $member (object) – Current Member model object
  • $values (array) – The Member model object data as an array
  • $modified (array) – An array of all the old values that were changed
Returns:

void

Return type:

NULL

New in version 3.1.0.

before_member_save

before_member_save($member, $values)

Called before the member object is inserted or updated. Changes made to the object will be saved automatically.

How it’s called:

ee()->extensions->call('before_member_save', $this, $this->getValues());
Parameters:
  • $member (object) – Current Member model object
  • $values (array) – The Member model object data as an array
Returns:

void

Return type:

NULL

New in version 3.1.0.

after_member_save

after_member_save($member, $values)

Called after the member object is inserted or updated. Changes made to the object will not be saved automatically. Calling save may fire additional hooks.

How it’s called:

ee()->extensions->call('after_member_save', $this, $this->getValues());
Parameters:
  • $member (object) – Current Member model object
  • $values (array) – The Member model object data as an array
Returns:

void

Return type:

NULL

New in version 3.1.0.

before_member_delete

before_member_delete($member, $values)

Called before the member object is deleted. If you are conditionally deleting one of your own models, please consider creating an inverse relationship instead. This will provide better performance and strictly enforce data consistency.

How it’s called:

ee()->extensions->call('before_member_delete', $this, $this->getValues());
Parameters:
  • $member (object) – Current Member model object
  • $values (array) – The Member model object data as an array
Returns:

void

Return type:

NULL

New in version 3.1.0.

after_member_delete

after_member_delete($member, $values)

Called after the member object is deleted. If you are conditionally deleting one of your own models, please consider creating an inverse relationship instead. This will provide better performance and strictly enforce data consistency.

How it’s called:

ee()->extensions->call('after_member_delete', $this, $this->getValues());
Parameters:
  • $member (object) – Current Member model object
  • $values (array) – The Member model object data as an array
Returns:

void

Return type:

NULL

New in version 3.1.0.

before_member_bulk_delete

before_member_bulk_delete($delete_ids)

Called before a bulk of member objects are deleted. If you need to do an expensive operation when members are deleted, it may be more efficient to handle it in bulk here.

How it’s called:

ee()->extensions->call('before_member_bulk_delete', $delete_ids);
Parameters:
  • $delete_ids (array) – The primary key IDs of the models being deleted
Returns:

void

Return type:

NULL

New in version 4.3.0.

after_member_bulk_delete

after_member_bulk_delete($delete_ids)

Called after a bulk of member objects are deleted. If you need to do an expensive operation when members are deleted, it may be more efficient to handle it in bulk here.

How it’s called:

ee()->extensions->call('after_member_bulk_delete', $delete_ids);
Parameters:
  • $delete_ids (array) – The primary key IDs of the models being deleted
Returns:

void

Return type:

NULL

New in version 4.3.0.

member_anonymize

member_anonymize($member)

Called when an anonymization action is taken on a member. If you have personally-identifiable information about members in your add-on, this is the place to implement your routines to anonymize that information.

How it’s called:

ee()->extensions->call('member_anonymize', $this);
Parameters:
  • $member (object) – Member model object being anonymized
Returns:

void

Return type:

NULL

New in version 4.3.0.