ExpressionEngine® User Guide

Legacy Documentation

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

ChannelField Model Extension Hooks

before_channel_field_insert

before_channel_field_insert($channel_field, $values)

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

How it’s called:

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

void

Return type:

NULL

New in version 3.3.0.

after_channel_field_insert

after_channel_field_insert($channel_field, $values)

Called after the channel field 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_channel_field_insert', $this, $this->getValues());
Parameters:
  • $channel_field (object) – Current ChannelField model object
  • $values (array) – The ChannelField model object data as an array
Returns:

void

Return type:

NULL

New in version 3.3.0.

before_channel_field_update

before_channel_field_update($channel_field, $values, $modified)

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

How it’s called:

ee()->extensions->call('before_channel_field_update', $this, $this->getValues(), $modified);
Parameters:
  • $channel_field (object) – Current ChannelField model object
  • $values (array) – The ChannelField 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.3.0.

after_channel_field_update

after_channel_field_update($channel_field, $values, $modified)

Called after the channel field 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_channel_field_update', $this, $this->getValues(), $modified);
Parameters:
  • $channel_field (object) – Current ChannelField model object
  • $values (array) – The ChannelField 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.3.0.

before_channel_field_save

before_channel_field_save($channel_field, $values)

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

How it’s called:

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

void

Return type:

NULL

New in version 3.3.0.

after_channel_field_save

after_channel_field_save($channel_field, $values)

Called after the channel field 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_channel_field_save', $this, $this->getValues());
Parameters:
  • $channel_field (object) – Current ChannelField model object
  • $values (array) – The ChannelField model object data as an array
Returns:

void

Return type:

NULL

New in version 3.3.0.

before_channel_field_delete

before_channel_field_delete($channel_field, $values)

Called before the channel field 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_channel_field_delete', $this, $this->getValues());
Parameters:
  • $channel_field (object) – Current ChannelField model object
  • $values (array) – The ChannelField model object data as an array
Returns:

void

Return type:

NULL

New in version 3.3.0.

after_channel_field_delete

after_channel_field_delete($channel_field, $values)

Called after the channel field 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_channel_field_delete', $this, $this->getValues());
Parameters:
  • $channel_field (object) – Current ChannelField model object
  • $values (array) – The ChannelField model object data as an array
Returns:

void

Return type:

NULL

New in version 3.3.0.

before_channel_field_bulk_delete

before_channel_field_bulk_delete($delete_ids)

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

How it’s called:

ee()->extensions->call('before_channel_field_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_channel_field_bulk_delete

after_channel_field_bulk_delete($delete_ids)

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

How it’s called:

ee()->extensions->call('after_channel_field_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.