本文整理汇总了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);
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}