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


PHP JCckDatabase::loadAssocList方法代碼示例

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


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

示例1: onCCK_Storage_LocationPrepareItems

 public function onCCK_Storage_LocationPrepareItems(&$field, &$storages, $pks, &$config = array(), $load = false)
 {
     if (self::$type != $field->storage_location) {
         return;
     }
     // Init
     $table = $field->storage_table;
     // Prepare
     if ($load) {
         if ($table == self::$table) {
             $storages[$table] = JCckDatabase::loadObjectList('SELECT * FROM ' . $table . ' WHERE ' . self::$key . ' IN (' . $config['pks'] . ')', self::$key);
             foreach ($storages[self::$table] as $s) {
                 $query = 'SELECT a.id FROM #__usergroups AS a INNER JOIN #__user_usergroup_map AS b ON b.group_id = a.id WHERE b.user_id = ' . $s->id;
                 $s->groups = JCckDatabase::loadAssocList($query, 'id', 'id');
                 $s->guest = NULL;
                 $s->password = '';
                 $s->password2 = '';
             }
         } else {
             $storages[$table] = JCckDatabase::loadObjectList('SELECT * FROM ' . $table . ' WHERE id IN (' . $config['pks'] . ')', 'id');
             if (!isset($storages[self::$table])) {
                 $storages['_'] = self::$table;
                 $storages[self::$table] = JCckDatabase::loadObjectList('SELECT * FROM ' . self::$table . ' WHERE ' . self::$key . ' IN (' . $config['pks'] . ')', self::$key);
                 foreach ($storages[self::$table] as $s) {
                     $query = 'SELECT a.id FROM #__usergroups AS a INNER JOIN #__user_usergroup_map AS b ON b.group_id = a.id WHERE b.user_id = ' . $s->id;
                     $s->groups = JCckDatabase::loadAssocList($query, 'id', 'id');
                     $s->guest = NULL;
                     $s->password = '';
                     $s->password2 = '';
                 }
             }
         }
     }
     $config['author'] = (int) $storages[self::$table][$config['pk']]->{self::$key};
 }
開發者ID:kenyonjohnston,項目名稱:hott_theater,代碼行數:35,代碼來源:joomla_user.php


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