You are here

public function RedhenContactType::save in RedHen CRM 7

Override parent save method to ensure we have an email field for each type.

Overrides Entity::save

File

modules/redhen_contact/lib/redhen_contact_type.entity.inc, line 30
Redhen Contact type classes.

Class

RedhenContactType
RedhenContactType class.

Code

public function save() {
  $ret = parent::save();

  // Associate email field instance with contact.
  if ($ret) {

    // Create email field if it doesn't exist.
    redhen_fields_create_email_field();

    // Now create an instance of the email field for this contact type.
    redhen_fields_create_email_instance($this->name);
  }
}