You are here

function multiple_email_load in Multiple E-mail Addresses 7

Same name and namespace in other branches
  1. 6 multiple_email.module \multiple_email_load()
  2. 2.x multiple_email.module \multiple_email_load()

Loads a single address from the e-mail registry and returns it as an object.

Parameters

integer $eid:

Return value

object

7 calls to multiple_email_load()
multiple_email_delete_email in ./multiple_email.module
Deletes specified e-mail from registry - no error checking!
multiple_email_edit_form_submit in ./multiple_email_edit_page.inc
Processes form submission of multiple_email_edit_form
multiple_email_expire_address in ./multiple_email.module
Removes the specified address from the user who added it and sends their primary e-mail account a message notifying them about the expiration.
multiple_email_find_address in ./multiple_email.module
Finds the specified e-mail and returns an object containing its data. Returns false if e-mail cannot be found.
multiple_email_manage_submit in ./multiple_email_manage.inc
Handle submission of multiple_email_manage_form.

... See full list

File

./multiple_email.module, line 465
multiple_email module file

Code

function multiple_email_load($eid) {
  if (is_numeric($eid)) {
    $query = db_select('multiple_email', 'me')
      ->fields('me')
      ->condition('me.eid', $eid);
    $query
      ->addJoin('INNER', 'users', 'u', 'u.uid = me.uid');
    $query
      ->addExpression('IF(LOWER(me.email) = LOWER(u.mail), 1, 0)', 'primary_address');
    $result = $query
      ->execute();
    return $result
      ->fetchObject();
  }
}