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


PHP DBObject::importQueryResultToDbObject方法代碼示例

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


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

示例1: findByName

 public static function findByName($name)
 {
     global $mysqli;
     $query = 'SELECT * FROM site_permission WHERE name=' . DBObject::prepare_val_for_sql($name);
     $result = $mysqli->query($query);
     if ($result && ($b = $result->fetch_object())) {
         $obj = new SitePermission();
         DBObject::importQueryResultToDbObject($b, $obj);
         return $obj;
     }
     return null;
 }
開發者ID:jeffreycai,項目名稱:reader,代碼行數:12,代碼來源:SitePermission.class.php

示例2: findByName

 static function findByName($name)
 {
     global $mysqli;
     $query = 'SELECT * FROM block WHERE name=' . DBObject::prepare_val_for_sql($name) . ' LIMIT 1';
     $result = $mysqli->query($query);
     if ($result && ($b = $result->fetch_object())) {
         $obj = new Block();
         DBObject::importQueryResultToDbObject($b, $obj);
         return $obj;
     }
     return null;
 }
開發者ID:jeffreycai,項目名稱:ct21,代碼行數:12,代碼來源:Block.class.php

示例3: findByName

 static function findByName($name)
 {
     global $mysqli;
     $query = 'SELECT * FROM vars WHERE name=' . DBObject::prepare_val_for_sql($name);
     $result = $mysqli->query($query);
     if ($result && ($v = $result->fetch_object())) {
         $var = new Vars();
         DBObject::importQueryResultToDbObject($v, $var);
         return $var;
     }
     return null;
 }
開發者ID:jeffreycai,項目名稱:chaoliu,代碼行數:12,代碼來源:Vars.class.php

示例4: findByUId

 public static function findByUId($uid)
 {
     global $mysqli;
     $query = 'SELECT * FROM site_profile WHERE user_id=' . $uid;
     $result = $mysqli->query($query);
     if ($result && ($b = $result->fetch_object())) {
         $obj = new SiteProfile();
         DBObject::importQueryResultToDbObject($b, $obj);
         return $obj;
     }
     return null;
 }
開發者ID:jeffreycai,項目名稱:chaoliu,代碼行數:12,代碼來源:SiteProfile.class.php

示例5: findByCombo

 static function findByCombo($bizid, $mid, $idx, $instance = "WechatArticle")
 {
     global $mysqli;
     $query = "SELECT * FROM wechat_article WHERE biz_id=" . DBObject::prepare_val_for_sql($bizid) . " AND mid=" . DBObject::prepare_val_for_sql($mid) . " AND idx=" . $idx . " LIMIT 1";
     $result = $mysqli->query($query);
     if ($result && ($b = $result->fetch_object())) {
         $obj = new $instance();
         DBObject::importQueryResultToDbObject($b, $obj);
         return $obj;
     }
     return null;
 }
開發者ID:jeffreycai,項目名稱:reader,代碼行數:12,代碼來源:WechatArticle.class.php

示例6: findAllByCountryId

 static function findAllByCountryId($cid)
 {
     global $mysqli;
     $query = "SELECT * FROM course WHERE country_id={$cid} ORDER BY weight ASC";
     $result = $mysqli->query($query);
     $rtn = array();
     while ($result && ($b = $result->fetch_object())) {
         $obj = new Institution();
         DBObject::importQueryResultToDbObject($b, $obj);
         $rtn[] = $obj;
     }
     return $rtn;
 }
開發者ID:jeffreycai,項目名稱:ct21,代碼行數:13,代碼來源:Course.class.php

示例7: findByUid

 static function findByUid($uid)
 {
     global $mysqli;
     $query = 'SELECT * FROM site_user_role WHERE user_id=' . $uid;
     $result = $mysqli->query($query);
     $rtn = array();
     while ($result && ($b = $result->fetch_object())) {
         $obj = new SiteUserRole();
         DBObject::importQueryResultToDbObject($b, $obj);
         $rtn[] = $obj;
     }
     return $rtn;
 }
開發者ID:jeffreycai,項目名稱:reader,代碼行數:13,代碼來源:SiteUserRole.class.php

示例8: findByAccountId

 static function findByAccountId($account_id)
 {
     global $mysqli;
     $query = "SELECT * FROM wechat_account_user WHERE account_id=" . $account_id;
     $result = $mysqli->query($query);
     $rtn = array();
     while ($result && ($b = $result->fetch_object())) {
         $obj = new WechatAccountUser();
         DBObject::importQueryResultToDbObject($b, $obj);
         $rtn[] = $obj;
     }
     return $rtn;
 }
開發者ID:jeffreycai,項目名稱:reader,代碼行數:13,代碼來源:WechatAccountUser.class.php

示例9: findAll

 static function findAll()
 {
     global $mysqli;
     $query = "SELECT * FROM carousel ORDER BY weight ASC";
     $result = $mysqli->query($query);
     $rtn = array();
     while ($result && ($b = $result->fetch_object())) {
         $obj = new Carousel();
         DBObject::importQueryResultToDbObject($b, $obj);
         $rtn[] = $obj;
     }
     return $rtn;
 }
開發者ID:jeffreycai,項目名稱:ct21,代碼行數:13,代碼來源:Carousel.class.php

示例10: findAllPublished

 static function findAllPublished()
 {
     global $mysqli;
     $query = "SELECT * FROM page WHERE published=1";
     $result = $mysqli->query($query);
     $rtn = array();
     while ($result && ($b = $result->fetch_object())) {
         $obj = new Page();
         DBObject::importQueryResultToDbObject($b, $obj);
         $rtn[] = $obj;
     }
     return $rtn;
 }
開發者ID:jeffreycai,項目名稱:ct21,代碼行數:13,代碼來源:Page.class.php

示例11: getPermissions

 public function getPermissions()
 {
     global $mysqli;
     $query = "SELECT P.* FROM site_permission_role AS PR, site_permission AS P WHERE P.id=PR.permission_id AND PR.role_id=" . $this->getid();
     $result = $mysqli->query($query);
     $rtn = array();
     while ($result && ($b = $result->fetch_object())) {
         $obj = new SitePermission();
         DBObject::importQueryResultToDbObject($b, $obj);
         $rtn[] = $obj;
     }
     return $rtn;
 }
開發者ID:jeffreycai,項目名稱:reader,代碼行數:13,代碼來源:SiteRole.class.php

示例12: findAll

 static function findAll($limit = false)
 {
     global $mysqli;
     $query = "SELECT * FROM news ORDER BY date DESC" . ($limit ? " LIMIT {$limit}" : "");
     $result = $mysqli->query($query);
     $rtn = array();
     while ($result && ($b = $result->fetch_object())) {
         $obj = new News();
         DBObject::importQueryResultToDbObject($b, $obj);
         $rtn[] = $obj;
     }
     return $rtn;
 }
開發者ID:jeffreycai,項目名稱:ct21,代碼行數:13,代碼來源:News.class.php

示例13: findAllByCountryId

 static function findAllByCountryId($cid)
 {
     global $mysqli;
     $query = 'SELECT * FROM menu WHERE country_id=' . DBObject::prepare_val_for_sql($cid);
     $result = $mysqli->query($query);
     $rtn = array();
     while ($result && ($b = $result->fetch_object())) {
         $obj = new Menu();
         DBObject::importQueryResultToDbObject($b, $obj);
         $rtn[] = $obj;
     }
     return $rtn;
 }
開發者ID:jeffreycai,項目名稱:ct21,代碼行數:13,代碼來源:Menu.class.php

示例14: findAllByMenuId

 static function findAllByMenuId($menu_id)
 {
     global $mysqli;
     $query = "SELECT * FROM menu_item WHERE menu_id={$menu_id}";
     $result = $mysqli->query($query);
     $rtn = array();
     while ($result && ($b = $result->fetch_object())) {
         $obj = new MenuItem();
         DBObject::importQueryResultToDbObject($b, $obj);
         $rtn[] = $obj;
     }
     return $rtn;
 }
開發者ID:jeffreycai,項目名稱:ct21,代碼行數:13,代碼來源:MenuItem.class.php

示例15: findAllToCrawl

 static function findAllToCrawl($span = 3600)
 {
     global $mysqli;
     $query = "SELECT * FROM wechat_account WHERE active=1 AND (last_scheduled IS NULL OR last_scheduled < " . (time() - $span) . ")";
     $result = $mysqli->query($query);
     $rtn = array();
     while ($result && ($b = $result->fetch_object())) {
         $obj = new WechatAccount();
         DBObject::importQueryResultToDbObject($b, $obj);
         $rtn[] = $obj;
     }
     return $rtn;
 }
開發者ID:jeffreycai,項目名稱:reader,代碼行數:13,代碼來源:WechatAccount.class.php


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