当前位置: 首页>>代码示例>>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;未经允许,请勿转载。