本文整理汇总了PHP中oseDB::loadItem方法的典型用法代码示例。如果您正苦于以下问题:PHP oseDB::loadItem方法的具体用法?PHP oseDB::loadItem怎么用?PHP oseDB::loadItem使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类oseDB
的用法示例。
在下文中一共展示了oseDB::loadItem方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getItem
function getItem()
{
$result = array();
$post = JRequest::get('post');
$post = oseMscAddon::getPost('licseat_', $post);
if (!isset($post['contact_send'])) {
$post['contact_send'] = 0;
}
if (!isset($post['internal_contact_send'])) {
$post['internal_contact_send'] = 0;
}
$db = oseDB::instance();
$msc_id = JRequest::getInt('msc_id', 0);
$member_id = JRequest::getInt('member_id', 0);
$mscLicInfo = oseRegistry::call('msc')->getExtInfo($msc_id, 'lic', 'obj');
$mscLicInfoParams = oseObject::getParams($mscLicInfo);
$where = array();
$where[] = "license_user_id = '{$member_id}'";
if (empty($mscLicInfoParams->id)) {
$where[] = "license_id = '{$mscLicInfoParams->id}'";
}
$where = oseDB::implodeWhere();
$query = " SELECT * FROM `#__oselic_license_seat`" . $where . " ORDER BY id DESC";
$db->setQuery($query);
$item = oseDB::loadItem('obj');
$result['success'] = empty($item) ? false : true;
$result['total'] = empty($item) ? 0 : 1;
$result['result'] = empty($item) ? array() : $item;
//$result = oseJson::encode($result);
return $result;
}
示例2: getBasicInfo
function getBasicInfo($type = 'array')
{
$db = oseDB::instance();
$query = " SELECT id,username,name,email,params " . " FROM `#__users` WHERE id = " . (int) $this->user_id;
$db->setQuery($query);
return oseDB::loadItem($type);
}
示例3: save
public static function save($params = array())
{
$db = oseDB::instance();
$post = JRequest::get('post');
$id = JRequest::getCmd('id', null);
$msc_id = JRequest::getInt('msc_id', 0);
if (empty($id)) {
$id = uniqid();
}
$extItem = oseRegistry::call('msc')->getExtInfoItem($msc_id, 'acymailing2', 'obj');
$extItem->params = empty($extItem->params) ? '{}' : $extItem->params;
$items = oseJson::decode($extItem->params, true);
$where = array();
$msc_id = isset($msc_id) ? $msc_id : null;
if (empty($msc_id)) {
return false;
// No membership exists in the addon
} else {
unset($post['msc_id']);
$where[] = 'id = ' . $db->Quote($msc_id);
}
$where[] = 'type = ' . $db->Quote('acymailing2');
$params = array();
$prefix = 'acymailing2_';
foreach ($post as $key => $value) {
if (strstr($key, $prefix)) {
$newKey = preg_replace("/{$prefix}/", '', $key, 1);
$params[$newKey] = $value;
}
}
ksort($params);
$params['id'] = $id;
$items[$id] = $params;
$newParams = $db->Quote(oseJson::encode($items));
$where = oseDB::implodeWhere($where);
$query = " SELECT * FROM `#__osemsc_ext` " . $where;
$db->setQuery($query);
$obj = oseDB::loadItem('obj');
if (empty($obj)) {
$query = " INSERT INTO `#__osemsc_ext` " . " (id,type,params)" . " VALUES " . " ({$msc_id}," . $db->Quote('acymailing2') . ",{$newParams}) ";
$db->setQuery($query);
//oseExit($db->_sql);
} else {
$query = " UPDATE `#__osemsc_ext` " . " SET " . " params = {$newParams} " . " WHERE id = {$obj->id}" . " AND type = " . $db->Quote('acymailing2');
$db->setQuery($query);
}
if (oseDB::query()) {
$result['success'] = true;
$result['title'] = JText::_('Finished');
$result['content'] = JText::_('Save Successfully!');
} else {
$result['success'] = false;
$result['title'] = JText::_('Error');
$result['content'] = JText::_('Error in Saving License Parameters');
}
return $result;
}
示例4: getItems
function getItems()
{
// Get a storage key.
$store = $this->getStoreId('getItems');
// Try to load the data from internal storage.
if (!empty($this->cache[$store])) {
return $this->cache[$store];
}
$search = $this->getState('filter.search');
$searchid = $this->getState('filter.searchid');
$searchpe = $this->getState('filter.searchpe');
// Load the list items.
$items = parent::getItems();
// If emtpy or an error, just return.
if (empty($items)) {
return array();
}
//oseExit($items);
$db = oseDB::instance();
// Inject the values back into the array.
foreach ($items as $k => $item) {
$order_id = null;
if ($item->msc_id > 0) {
$params = oseJson::decode($item->params);
$order_id = oseGetValue($params, 'order_id', 0);
$query = " SELECT `title` FROM `#__osemsc_acl`" . " WHERE `id` = '{$item->msc_id}'";
$db->setQuery($query);
$item->membership = $db->loadResult();
$query = " SELECT *" . " FROM `#__osemsc_order_fix`" . " WHERE `member_id` = '{$item->id}'";
$db->setQuery($query);
$ofItem = oseDB::loadItem('obj');
$item->paypal_email = oseObject::getValue($ofItem, 'email', $item->email);
} else {
$item->expired_date = null;
$item->status = '';
}
if (empty($search) && empty($searchid) && empty($searchpe)) {
//return array();
} else {
//$item->order_number = null;
if (!empty($order_id)) {
$query = " SELECT `order_id`,`order_number`,`payment_serial_number`,`order_status`" . " FROM `#__osemsc_order`" . " WHERE `order_id` = '{$order_id}'";
$db->setQuery($query);
$oItem = oseDB::loadItem('obj');
$item->order_number = $oItem->order_number;
$item->order_id = $oItem->order_id;
$item->payment_serial_number = $oItem->payment_serial_number;
$item->order_status = $oItem->order_status;
} else {
}
}
$items[$k] = $item;
}
// Add the items to the internal cache.
$this->cache[$store] = $items;
return $this->cache[$store];
}
示例5: getConfigItem
static function getConfigItem($configItemName, $config_type, $type = 'array')
{
$db = oseDB::instance();
$configItemName = $db->Quote($configItemName);
$config_type = $db->Quote($config_type);
$query = " SELECT * FROM `#__osemsc_configuration`" . " WHERE `key` = {$configItemName} AND `type` = {$config_type}";
$db->setQuery($query);
$item = oseDB::loadItem($type);
return $item;
}
示例6: getProperty
function getProperty($msc_id)
{
$db = oseDB::instance();
oseDB::lock('#__osemsc_acl READ');
$query = " SELECT * FROM `#__osemsc_acl`" . " WHERE id = {$msc_id}";
$db->setQuery($query);
$item = oseDB::loadItem();
oseDB::unlock();
return $item;
}
示例7: getInfo
function getInfo($id, $type = 'array')
{
$db = oseDB::instance();
$where = array();
$where[] = "`id` = " . $db->Quote($id);
$where = oseDB::implodeWhere($where);
$query = " SELECT * FROM `#__osemsc_acl`" . " WHERE `id` = '{$id}'";
$db->setQuery($query);
$item = oseDB::loadItem($type);
return $item;
}
示例8: getGWInfo
public function getGWInfo($payment_method)
{
$db = oseDB::instance();
if (is_numeric($payment_method)) {
$query = " SELECT * FROM `#__osemsc_paymentgateway`" . " WHERE `id` = '{$payment_method}'";
} else {
$query = " SELECT * FROM `#__osemsc_paymentgateway`" . " WHERE `filename` = " . $db->Quote($payment_method);
}
$db->setQuery($query);
$item = oseDB::loadItem('obj');
return $item;
}
示例9: __construct
function __construct($p)
{
parent::__construct($p);
$db = oseDB::instance();
$query = " SELECT * FROM `{$this->_table}`" . " WHERE `plan_id` = '" . $this->get('plan_id') . "'";
$db->setQuery($query);
$item = oseDB::loadItem();
if (empty($item)) {
$this->create();
} else {
$this->setProperties($item);
}
}
示例10: getItemSubmit
function getItemSubmit($id, $entry_type = 'credit_submit', $type = 'array')
{
$db = oseDB::instance();
if (empty($id)) {
return false;
}
$where = array();
$where[] = "`id` = " . (int) $id;
$where[] = "`entry_type` = " . $db->Quote($entry_type, true);
$where = oseDB::implodeWhere($where);
$query = " SELECT * FROM `{$this->table}`" . $where;
$db->setQuery($query);
$item = oseDB::loadItem($type);
return $item;
}
示例11: getItem
public static function getItem($params = array())
{
$member_id = JRequest::getInt('member_id', 0);
$db = oseDB::instance();
$query = " SELECT * FROM `#__osemsc_userinfo_view` " . " WHERE user_id = {$member_id}";
$db->setQuery($query);
$info = oseDB::loadItem();
if (empty($info)) {
$result['total'] = 0;
$result['result'] = '';
} else {
$result['total'] = 1;
$result['result'] = $info;
}
return $result;
}
示例12: getItem
function getItem($cType, $content_type, $content_id, $entry_type = 'msc', $entry_id, $status = null, $type = 'array')
{
$db = oseDB::instance();
$where = array();
$where[] = "content_id = {$content_id}";
$where[] = "content_type='{$content_type}'";
$where[] = "type = '{$cType}'";
$where[] = "entry_id = {$entry_id}";
$where[] = "entry_type = '{$entry_type}'";
if (!empty($status) || $status == '0') {
$where[] = "status = {$status}";
}
$where = oseDB::implodeWhere($where);
$query = " SELECT * FROM `#__osemsc_content`" . $where;
$db->setQuery($query);
$item = oseDB::loadItem($type);
return $item;
}
示例13: getFaith
function getFaith()
{
$id = JRequest::getInt('id',0);
$db= oseDB::instance();
$query = " SELECT * FROM `#__osemsc_email` "
." WHERE type = 'faith' AND id = {$id} "
;
$db->setQuery($query);
$term = oseDB::loadItem();
$result = empty($term)?'':$term;
$result = oseJson::encode($result);
oseExit($result);
}
示例14: removeAllCurrency
function removeAllCurrency()
{
$db = oseDB::instance();
$query = " SELECT * FROM `#__osemsc_configuration`" . " WHERE `key` = 'primary_currency' AND `type` = 'currency'";
$db->setQuery($query);
$item = oseDB::loadItem('obj');
//$currencyInfos = oseJson::decode($item->default,true);
//unset($currencyInfos[$currency]);
$currencyInfos = oseJson::encode(null);
$query = " UPDATE `#__osemsc_configuration`" . " SET `default` = " . $db->Quote($currencyInfos) . " WHERE `id` = '{$item->id}'";
$db->setQuery($query);
return oseDB::query();
}
示例15: changeStatus
function changeStatus()
{
$db = oseDB::instance();
//$app = JFactory::getApplication();
//$jMenu = $app->getMenu();
$msc_id = JRequest::getInt('msc_id', 0);
$menu_ids = JRequest::getVar('menu_ids', array());
$newStatus = JRequest::getInt('status', 0);
$timeLength = JRequest::getVar('time_length', array());
$timeUnit = JRequest::getVar('time_unit', array());
//$time_length = array();
//$time_unit = array();
$new_menu_ids = array();
foreach ($menu_ids as $menu_id) {
$new_menu_ids[$menu_id] = $menu_id;
//$time_length[$menu_id] = $timeLength[$key];
//$time_unit[$menu_id] = $timeUnit[$key];
$query = " SELECT * FROM `#__menu`" . " WHERE id = '{$menu_id}'";
$db->setQuery($query);
$menu = oseDB::loadItem('obj');
if ($menu->type == 'alias') {
$aliasoptions = oseJson::decode($menu->params)->aliasoptions;
$new_menu_ids[$aliasoptions] = $aliasoptions;
}
}
//$menu_ids = $new_menu_ids;
foreach ($menu_ids as $key => $menu_id) {
$content = oseRegistry::call('content')->getInstance('msc');
$item = $content->getItem('joomla', 'menu', $menu_id, 'msc', $msc_id, '', 'obj');
$ItemParams = array();
$ItemParams['time_length'] = $timeLength[$key];
$ItemParams['time_unit'] = $timeUnit[$key];
if (empty($item)) {
/*
if($menu->type == 'alias')
{
$aliasoptions = oseJson::decode($menu->params)->aliasoptions;
//$menu_ids[] = $aliasoptions;
$updated = $content->insert('joomla','menu',$menu_id,'msc',$msc_id, $newStatus,array('aliasoptions'=>$aliasoptions));
}
else
{
$updated = $content->insert('joomla','menu',$menu_id,'msc',$msc_id, $newStatus);
}
*/
$updated = $content->insert('joomla', 'menu', $menu_id, 'msc', $msc_id, $newStatus, $ItemParams);
if (!$updated) {
$result = array();
$result['success'] = false;
$result['title'] = JText::_('ERROR');
$result['content'] = JText::_('ERROR');
return $result;
}
} else {
$status = $item->status;
if ($status == $newStatus) {
//continue;
$updated = $content->update($item, $newStatus, $ItemParams);
if (!$updated) {
$result = array();
$result['success'] = false;
$result['title'] = JText::_('ERROR');
$result['content'] = JText::_('ERROR');
return $result;
}
} else {
/*
if($menu->type == 'alias')
{
$aliasoptions = oseJson::decode($menu->params)->aliasoptions;
$itemParams = oseJson::decode($item->params,true);
$itemParams['aliasoptions'] = $aliasoptions;
$updated = $content->update($item, $newStatus,$itemParams);
}
else
{
$updated = $content->update($item, $newStatus);
}
*/
$updated = $content->update($item, $newStatus, $ItemParams);
if (!$updated) {
$result = array();
$result['success'] = false;
$result['title'] = JText::_('ERROR');
$result['content'] = JText::_('ERROR');
return $result;
}
}
}
}
$result = array();
$result['success'] = true;
$result['title'] = JText::_('DONE');
$result['content'] = JText::_('SUCCESSFULLY');
return $result;
}