當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CI_DB_result::row方法代碼示例

本文整理匯總了PHP中CI_DB_result::row方法的典型用法代碼示例。如果您正苦於以下問題:PHP CI_DB_result::row方法的具體用法?PHP CI_DB_result::row怎麽用?PHP CI_DB_result::row使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CI_DB_result的用法示例。


在下文中一共展示了CI_DB_result::row方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _authenticate

 /**
  * Authenticate
  *
  * @access	private
  */
 private function _authenticate(CI_DB_result $member, $password)
 {
     $always_disallowed = array(4);
     if ($member->num_rows() !== 1) {
         return FALSE;
     }
     if (in_array($member->row('group_id'), $always_disallowed)) {
         return ee()->output->show_user_error('general', lang('mbr_account_not_active'));
     }
     $m_salt = $member->row('salt');
     $m_pass = $member->row('password');
     // hash using the algo used for this password
     $h_byte_size = strlen($m_pass);
     $hashed_pair = $this->hash_password($password, $m_salt, $h_byte_size);
     if ($hashed_pair === FALSE or $m_pass !== $hashed_pair['password']) {
         return FALSE;
     }
     // Officially a valid user, but are they as secure as possible?
     // ----------------------------------------------------------------
     reset($this->hash_algos);
     // Not hashed or better algo available?
     if (!$m_salt or $h_byte_size != key($this->hash_algos)) {
         $m_id = $member->row('member_id');
         $this->update_password($m_id, $password);
     }
     $authed = new Auth_result($member->row());
     $member->free_result();
     return $authed;
 }
開發者ID:nigelpeters,項目名稱:css-recruitment-ee,代碼行數:34,代碼來源:Auth.php

示例2: _process_query

 /**
  * Process Query
  *
  * Converts a query result into an array of objects.
  * Also updates this object
  *
  * @ignore
  * @param	CI_DB_result $query
  */
 protected function _process_query($query)
 {
     if ($query->num_rows() > 0) {
         // Populate all with records as objects
         $this->all = array();
         $this->_to_object($this, $query->row());
         // don't bother recreating the first item.
         $index = $this->all_array_uses_ids && isset($this->id) ? $this->id : 0;
         $this->all[$index] = $this->get_clone();
         if ($query->num_rows() > 1) {
             $model = get_class($this);
             $first = TRUE;
             foreach ($query->result() as $row) {
                 if ($first) {
                     $first = FALSE;
                     continue;
                 }
                 $item = new $model();
                 $this->_to_object($item, $row);
                 if ($this->all_array_uses_ids && isset($item->id)) {
                     $this->all[$item->id] = $item;
                 } else {
                     $this->all[] = $item;
                 }
             }
         }
         // remove instantiations
         $this->_instantiations = NULL;
         // free large queries
         if ($query->num_rows() > $this->free_result_threshold) {
             $query->free_result();
         }
     } else {
         // Refresh stored values is called by _to_object normally
         $this->_refresh_stored_values();
     }
 }
開發者ID:RVRKC,項目名稱:Hackathon_2015,代碼行數:46,代碼來源:datamapper.php

示例3: authenticate

 public function authenticate(CI_DB_result $query)
 {
     $data = $query->row();
     $this->core->session->set_userdata(array('id' => $data->id, 'logged_in' => TRUE));
 }
開發者ID:bagaswidodo,項目名稱:ci3-app,代碼行數:5,代碼來源:Auth.php


注:本文中的CI_DB_result::row方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。