_init('pap/user', 'userid'); } // the base getTable() may tack on an unwanted prefix. Kill it here. public function getTable($name) { $ret = parent::getTable($name); $tablePrefix = (string)Mage::getConfig()->getTablePrefix(); $ret = preg_replace('~^'.preg_quote($tablePrefix).'~', '', $ret); return $ret; } function loadByEmail($user, $email) { // find the user ID for the email address $select = $this->_getReadAdapter()->select() ->from("qu_pap_users", array("userid")) ->join("qu_g_users", "qu_pap_users.accountuserid = qu_g_users.accountuserid") ->join("qu_g_authusers", "qu_g_users.authid = qu_g_authusers.authid") ->where('qu_g_authusers.username=?', $email); $id = $this->_getReadAdapter()->fetchOne($select); if ($id) { $this->load($user, $id); } else { $user->setData(array()); } return $this; } } ?>