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


PHP JCckDatabase::loadObjectlist方法代碼示例

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


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

示例1: loadContent

    public function loadContent($id)
    {
        $this->_columns = $this->_getProperties();
        $this->_instance_core = JTable::getInstance($this->_columns['table_object'][0], $this->_columns['table_object'][1]);
        if (!isset($id)) {
            return;
        }
        $base = JCckDatabase::loadObject('SELECT id, cck, pk, storage_location FROM #__cck_core WHERE storage_location = "' . (string) $this->_object . '" AND pk = ' . (int) $id);
        $this->_type = $base->cck;
        $this->_pk = $base->pk;
        $this->_id = $base->id;
        if (!$this->_columns['table']) {
            return;
        }
        $this->_table = $this->_columns['table'];
        $this->_properties = JCckDatabase::loadObject('SELECT a.*, b.* FROM ' . $this->_table . ' AS a' . ' LEFT JOIN #__cck_store_form_' . $this->_type . ' AS b ON b.id = a.' . $this->_columns['key'] . ' WHERE a.' . $this->_columns['key'] . ' = ' . (int) $this->_pk);
        //look for fieldx
        $this->_fieldx = JCckDatabase::loadObjectlist('SELECT
		c.`name`,
		c.type,
		c.extended,
		c.storage_table,
		c.storage_field
		FROM
		aura_cck_core_types AS a
		Left Join aura_cck_core_type_field As b ON b.typeid = a.id
		Left Join aura_cck_core_fields As c ON c.id = b.fieldid
		WHERE
		a.`name` = \'' . $base->cck . '\' AND
		c.type = \'field_x\'
		');
        if (is_array($this->_fieldx)) {
            //FOUND FIELD X
            foreach ($this->_fieldx as $key => $value) {
                $data = $this->_properties->{$value->storage_field};
                $field_x = $value->name;
                $pattern = "/::" . $field_x . "::(.*)::\\/" . $field_x . "::/i";
                preg_match($pattern, $data, $matches);
                if (count($matches) > 0) {
                    $total_array = $matches[1];
                    if ($total_array > 0) {
                        $this->_properties->{$field_x} = array();
                        for ($i = 0; $i < $total_array; $i++) {
                            $pattern = "/::.*\\|{$i}\\|{$field_x}::(.*)::\\/.*\\|{$i}\\|{$field_x}::/i";
                            preg_match($pattern, $data, $matches);
                            $this->_properties->{$field_x}[] = $matches[1];
                        }
                    }
                }
            }
        }
        if ($this->_object == "joomla_user") {
            $db = JFactory::getDbo();
            $query = $db->getQuery(true);
            $field = array('group_id');
            $table = '#__user_usergroup_map';
            $query->select($db->quoteName($field));
            $query->from($db->quoteName($table));
            $query->where($db->quoteName('user_id') . '= ' . $db->quote($id));
            $db->setQuery($query);
            $result = $db->loadObject();
            if ($result) {
                $this->_properties->usergroup = $result->group_id;
            }
        }
        return $this->_properties;
    }
開發者ID:kolydart,項目名稱:simpleseblodapi,代碼行數:67,代碼來源:dxseblodapi.php


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