fromObject($set); if ($mappingEmail2userid->isEmpty()) { return false; } if (! is_numeric($mappingEmail2userid->userid)) { return false; } $data = $mappingEmail2userid->toArray(); $this->detachToken($data); $name = $this->_name; $this->_name = $this->getTable(); try { $email = $this->insert($data); } catch (Exception $e) { $email = false; } $this->_name = $name; return $email; } /** * * @param string $username * @return BigInteger|null 如果失败返回 null */ public function getUseridByEmail($email) { $email = (string) $email; $this->detachToken($email); $userid = null; $where = $this->getAdapter()->quoteInto($this->getAdapter()->quoteIdentifier('email') . " = ?", $email); $sql = 'SELECT userid FROM ' . $this->getTable() . ' WHERE ' . $where; $row = $this->getAdapter()->query($sql)->fetchColumn(0); if ($row && is_numeric($row)) { $userid = $row; } return $userid; } /** * @return Com_Model_Mapping_Email2userid */ public static function instance() { return parent::_instance(__CLASS__); } } // End ^ Native EOL ^ encoding