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


PHP JDatabaseDriver::loadAssoc方法代碼示例

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


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

示例1: load

 /**
  * This method loads data about e-mail template from a database.
  *
  * <code>
  * $emailId = 1;
  *
  * $email   = new Emailtemplates\Email();
  * $email->setDb(JFactory::getDbo());
  * $email->load($emailId);
  * </code>
  * 
  * @param int $id
  */
 public function load($id)
 {
     $query = $this->db->getQuery(true);
     $query->select('a.id, a.title, a.subject, a.body, a.sender_name, a.sender_email, a.catid')->from($this->db->quoteName('#__emailtemplates_emails', 'a'))->where('a.id = ' . (int) $id);
     $this->db->setQuery($query);
     $result = (array) $this->db->loadAssoc();
     $this->bind($result);
 }
開發者ID:ITPrism,項目名稱:CrowdfundingDistribution,代碼行數:21,代碼來源:Email.php

示例2: load

 /**
  * This method loads data about category from a database.
  *
  * <code>
  * $db         = JFactory::getDbo();
  * $categoryId = 1;
  *
  * $category   = new UserIdeasCategory();
  * $category->setDb($db);
  * $category->load($categoryId);
  * </code>
  */
 public function load($id)
 {
     $query = $this->db->getQuery(true);
     $query->select("a.title, a.description," . $query->concatenate(array("a.id", "a.alias"), ":") . " AS slug")->from($this->db->quoteName("#__categories", "a"))->where("a.id = " . (int) $id)->where("a.extension = " . $this->db->quote("com_userideas"));
     $this->db->setQuery($query);
     $result = $this->db->loadAssoc();
     if (!empty($result)) {
         $this->bind($result);
     }
 }
開發者ID:pippogsm,項目名稱:UserIdeas,代碼行數:22,代碼來源:category.php

示例3: load

 /**
  * This method loads data about e-mail template from a database.
  *
  * <code>
  * $emailId = 1;
  *
  * $email   = new UserIdeasEmail();
  * $email->setDb(JFactory::getDbo());
  * $email->load($emailId);
  * </code>
  */
 public function load($id)
 {
     $query = $this->db->getQuery(true);
     $query->select("a.id, a.title, a.subject, a.body, a.sender_name, a.sender_email")->from($this->db->quoteName("#__uideas_emails", "a"))->where("a.id = " . (int) $id);
     $this->db->setQuery($query);
     $result = $this->db->loadAssoc();
     if (!empty($result)) {
         $this->bind($result);
     }
 }
開發者ID:pippogsm,項目名稱:UserIdeas,代碼行數:21,代碼來源:email.php

示例4: load

 /**
  * Load country data from database.
  *
  * <code>
  * $countryId = 1;
  *
  * $country   = new CrowdFundingCountry(JFactory::getDbo());
  * $country->load($countryId);
  * </code>
  *
  * @param int $id
  */
 public function load($id)
 {
     $query = $this->db->getQuery(true);
     $query->select("a.id, a.name, a.code, a.code4, a.latitude, a.longitude, a.currency, a.code")->from($this->db->quoteName("#__crowdf_countries", "a"))->where("a.id = " . (int) $id);
     $this->db->setQuery($query);
     $result = $this->db->loadAssoc();
     if (!empty($result)) {
         $this->bind($result);
     }
 }
開發者ID:phpsource,項目名稱:CrowdFunding,代碼行數:22,代碼來源:country.php

示例5: load

 /**
  * Load location data from database.
  *
  * <code>
  * $locationId = 1;
  *
  * $location   = new Crowdfunding\Location(\JFactory::getDbo());
  * $location->load($locationId);
  * </code>
  *
  * @param int $id
  */
 public function load($id)
 {
     $query = $this->db->getQuery(true);
     $query->select("a.id, a.name, a.latitude, a.longitude, a.country_code, a.state_code, a.timezone, a.published")->from($this->db->quoteName("#__crowdf_locations", "a"))->where("a.id = " . (int) $id);
     $this->db->setQuery($query);
     $result = $this->db->loadAssoc();
     if (!empty($result)) {
         $this->bind($result);
     }
 }
開發者ID:bharatthakkar,項目名稱:CrowdFunding,代碼行數:22,代碼來源:Location.php

示例6: load

 /**
  * Load account data from database.
  *
  * <code>
  * $id = 1;
  *
  * $paymentSession   = new VirtualCurrencyPaymentSession(JFactory::getDbo());
  * $paymentSession->load($id);
  * </code>
  *
  * @param int $id
  */
 public function load($id)
 {
     $query = $this->db->getQuery(true);
     $query->select("a.id, a.user_id, a.currency_id, a.amount, a.record_date")->from($this->db->quoteName("#__vc_paymentsessions", "a"))->where("a.id = " . (int) $id);
     $this->db->setQuery($query);
     $result = $this->db->loadAssoc();
     if (!$result) {
         $result = array();
     }
     $this->bind($result);
 }
開發者ID:bellodox,項目名稱:VirtualCurrency,代碼行數:23,代碼來源:session.php

示例7: load

 /**
  * Load user data from database.
  *
  * <code>
  * $keys = array(
  *    "user_id" => 1
  * );
  *
  * $user    = new IdentityProofUser();
  * $user->setDb(JFactory::getDbo());
  * $user->load($keys);
  * </code>
  *
  * @param int $id Primary Key
  */
 public function load($id)
 {
     $query = $this->db->getQuery(true);
     $query->select("a.id, a.state, " . "b.name")->from($this->db->quoteName("#__identityproof_users", "a"))->leftJoin($this->db->quoteName("#__users", "b") . " ON a.id = b.id")->where("a.id = " . (int) $id);
     $this->db->setQuery($query);
     $result = $this->db->loadAssoc();
     if (!$result) {
         $result = array();
     }
     $this->bind($result);
 }
開發者ID:xop32,項目名稱:Proof-of-Identity,代碼行數:26,代碼來源:user.php

示例8: load

 /**
  * Load user data
  *
  * <code>
  * $userId = 1;
  *
  * $profile = new ITPrismIntegrateProfileKunena();
  * $profile->load($userId);
  * </code>
  *
  * @param int $id
  */
 public function load($id)
 {
     $query = $this->db->getQuery(true);
     $query->select("a.userid AS user_id, a.avatar")->from($this->db->quoteName("#__kunena_users", "a"))->where("a.userid = " . (int) $id);
     $this->db->setQuery($query);
     $result = $this->db->loadAssoc();
     if (!empty($result)) {
         // Set values to variables
         $this->bind($result);
     }
 }
開發者ID:johngrange,項目名稱:wookeyholeweb,代碼行數:23,代碼來源:kunena.php

示例9: load

 /**
  * Load data of a record from database.
  *
  * <code>
  * $id = 1;
  *
  * $partner    = new CrowdfundingPartners\Partner();
  * $partner->setDb(\JFactory::getDbo());
  * $partner->load($id);
  * </code>
  *
  * @param int $keys
  * @param array $options
  */
 public function load($keys, $options = array())
 {
     $query = $this->db->getQuery(true);
     $query->select("a.id, a.name, a.project_id, a.partner_id")->from($this->db->quoteName("#__cfpartners_partners", "a"))->where("a.id = " . (int) $keys);
     $this->db->setQuery($query);
     $result = $this->db->loadAssoc();
     if (!$result) {
         $result = array();
     }
     $this->bind($result);
 }
開發者ID:pashakiz,項目名稱:crowdf,代碼行數:25,代碼來源:Partner.php

示例10: load

 /**
  * Load a data about a type from database.
  *
  * @param int $id Type ID
  *
  * <code>
  * $typeId  = 1;
  *
  * $type    = new CrowdFundingType(JFactory::getDbo());
  * $type->load($typeId);
  * </code>
  */
 public function load($id)
 {
     $query = $this->db->getQuery(true);
     $query->select("a.id, a.title, a.description, a.params")->from($this->db->quoteName("#__crowdf_types", "a"))->where("a.id = " . (int) $id);
     $this->db->setQuery($query);
     $result = $this->db->loadAssoc();
     if (!$result) {
         $result = array();
     }
     $this->bind($result);
 }
開發者ID:phpsource,項目名稱:CrowdFunding,代碼行數:23,代碼來源:type.php

示例11: load

 /**
  * This method loads data about a status from a database.
  *
  * <code>
  * $statusId = 1;
  *
  * $status   = new UserIdeasStatus(JFactory::getDbo());
  * $status->load($statusId);
  * </code>
  */
 public function load()
 {
     $query = $this->db->getQuery(true);
     $query->select("a.id, a.name, a.default, a.params")->from($this->db->quoteName("#__uideas_statuses", "a"))->where("a.id = " . (int) $this->id);
     $this->db->setQuery($query);
     $result = $this->db->loadAssoc();
     if (!empty($result)) {
         if (!empty($result["params"])) {
             $params = json_decode($result["params"]);
             if (!empty($params)) {
                 $result["params"] = $params;
             }
         }
         $this->bind($result);
     }
 }
開發者ID:johngrange,項目名稱:wookeyholeweb,代碼行數:26,代碼來源:status.php

示例12: load

 /**
  * Load user data
  *
  * <code>
  * $keys = array(
  *     'user_id' => $userId
  * );
  *
  * $profile = new Prism\Integration\Profile\Socialcommunity(\JFactory::getDbo());
  * $profile->load($keys);
  * </code>
  * 
  * @param array $keys
  * @param array $options
  */
 public function load($keys, array $options = array())
 {
     $query = $this->db->getQuery(true);
     $query->select('a.id, a.user_id, a.image_icon, a.image_small, a.image_square, a.image, a.active, ' . $query->concatenate(array('a.id', 'a.alias'), ':') . ' AS slug, ' . 'b.name as location, b.country_code')->from($this->db->quoteName('#__itpsc_profiles', 'a'))->leftJoin($this->db->quoteName('#__itpsc_locations', 'b') . ' ON a.location_id = b.id');
     // Filter by keys.
     if (!is_array($keys)) {
         $query->where('a.id = ' . (int) $keys);
     } else {
         foreach ($keys as $key => $value) {
             $query->where($this->db->quoteName('a.' . $key) . ' = ' . $this->db->quote($value));
         }
     }
     $this->db->setQuery($query);
     $result = (array) $this->db->loadAssoc();
     $this->bind($result);
 }
開發者ID:ITPrism,項目名稱:SocialCommunityDistribution,代碼行數:31,代碼來源:Socialcommunity.php

示例13: load

 /**
  * Load user data from database.
  *
  * <code>
  * $userId = 1;
  *
  * $profile = new Prism\Integration\Profile\EasySocial(\JFactory::getDbo());
  * $profile->load($userId);
  * </code>
  *
  * @param int $id
  */
 public function load($id)
 {
     $query = $this->db->getQuery(true);
     $query->select('a.id AS user_id, a.name, a.username, ' . 'b.alias, b.permalink, ' . 'c.small, c.medium, c.square, c.large')->from($this->db->quoteName('#__users', 'a'))->leftJoin($this->db->quoteName('#__social_users', 'b') . ' ON a.id = b.user_id')->leftJoin($this->db->quoteName('#__social_avatars', 'c') . ' ON a.id = c.uid')->where('a.id =' . (int) $id);
     $this->db->setQuery($query);
     $result = (array) $this->db->loadAssoc();
     $this->bind($result);
 }
開發者ID:bellodox,項目名稱:PrismLibrary,代碼行數:20,代碼來源:EasySocial.php

示例14: load

 /**
  * Load user data
  *
  * <code>
  * $userId = 1;
  *
  * $profile = new Prism\Integration\Profile\EasyProfile(\JFactory::getDbo());
  * $profile->load($userId);
  * </code>
  * 
  * @param int $id User ID.
  */
 public function load($id)
 {
     $query = $this->db->getQuery(true);
     $query->select("a.id AS user_id, a.avatar, " . $query->concatenate(array("b.id", "b.username"), ":") . " AS slug")->from($this->db->quoteName("#__jsn_users", "a"))->innerJoin($this->db->quoteName("#__users", "b") . " ON a.id = b.id")->where("a.id = " . (int) $id);
     $this->db->setQuery($query);
     $result = (array) $this->db->loadAssoc();
     $this->bind($result);
 }
開發者ID:pashakiz,項目名稱:crowdf,代碼行數:20,代碼來源:EasyProfile.php

示例15: load

 /**
  * Load user data
  *
  * <code>
  * $userId = 1;
  *
  * $profile = new Prism\Integration\Profile\Gravatar(\JFactory::getDbo());
  * $profile->load($userId);
  * </code>
  * 
  * @param int $id
  */
 public function load($id)
 {
     $query = $this->db->getQuery(true);
     $query->select("a.id AS user_id, a.email, MD5(a.email) as hash")->from($this->db->quoteName("#__users", "a"))->where("a.id = " . (int) $id);
     $this->db->setQuery($query);
     $result = (array) $this->db->loadAssoc();
     $this->bind($result);
 }
開發者ID:pashakiz,項目名稱:crowdf,代碼行數:20,代碼來源:Gravatar.php


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