本文整理匯總了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;
}