本文整理汇总了PHP中stdClass::load方法的典型用法代码示例。如果您正苦于以下问题:PHP stdClass::load方法的具体用法?PHP stdClass::load怎么用?PHP stdClass::load使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类stdClass
的用法示例。
在下文中一共展示了stdClass::load方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: buildManufacturerTree
/**
* Creates fake root for manufacturer tree, and ads category list fileds for each manufacturer item
*
* @param string $sLinkTarget Name of class, responsible for category rendering
* @param string $sActCat Active category
* @param string $sShopHomeUrl base shop url ($myConfig->getShopHomeURL())
*/
public function buildManufacturerTree($sLinkTarget, $sActCat, $sShopHomeUrl)
{
//Load manufacturer list
$this->loadManufacturerList();
//Create fake manufacturer root category
$this->_oRoot = oxNew("oxManufacturer");
$this->_oRoot->load("root");
//category fields
$this->_addCategoryFields($this->_oRoot);
$this->_aPath[] = $this->_oRoot;
foreach ($this as $sVndId => $oManufacturer) {
// storing active manufacturer object
if ((string) $sVndId === $sActCat) {
$this->setClickManufacturer($oManufacturer);
}
$this->_addCategoryFields($oManufacturer);
if ($sActCat == $oManufacturer->oxmanufacturers__oxid->value) {
$this->_aPath[] = $oManufacturer;
}
}
$this->_seoSetManufacturerData();
}
示例2: buildVendorTree
/**
* Creates fake root for vendor tree, and ads category list fileds for each vendor item
*
* @param string $sLinkTarget Name of class, responsible for category rendering
* @param string $sActCat Active category
* @param string $sShopHomeUrl base shop url ($myConfig->getShopHomeUrl())
*/
public function buildVendorTree($sLinkTarget, $sActCat, $sShopHomeUrl)
{
$sActCat = str_replace('v_', '', $sActCat);
//Load vendor list
$this->loadVendorList();
//Create fake vendor root category
$this->_oRoot = oxNew("oxVendor");
$this->_oRoot->load('root');
//category fields
$this->_addCategoryFields($this->_oRoot);
$this->_aPath[] = $this->_oRoot;
foreach ($this as $sVndId => $oVendor) {
// storing active vendor object
if ($sVndId == $sActCat) {
$this->setClickVendor($oVendor);
}
$this->_addCategoryFields($oVendor);
if ($sActCat == $oVendor->oxvendor__oxid->value) {
$this->_aPath[] = $oVendor;
}
}
$this->_seoSetVendorData();
}
示例3: upgrade
function upgrade()
{
$database =& JFactory::getDBO();
$absolute_path = JPATH_ROOT;
$config =& JFactory::getConfig();
$dbprefix = $config->get('dbprefix');
$row = new stdClass();
//echo $db;
$row->message = "";
$row->database_version = 1;
if (TableExists($dbprefix . "swmenufree_config")) {
$query = "SELECT * FROM #__swmenufree_config WHERE id = 1";
$database->setQuery($query);
$result = $database->loadObjectList();
$swmenufree = array();
$sql = "SELECT id FROM #__modules where module='mod_swmenufree' AND published > -1";
$database->setQuery($sql);
$id = $database->loadResult();
$row =& JTable::getInstance('module');
// load the row from the db table
$row->load($id);
$row->message = "";
if ($result) {
$style = $row->params;
while (list($key, $val) = each($result[0])) {
$swmenufree[$key] = $val;
if ($key == 'id') {
$val = $row->id;
$style .= $key . "=" . $val . "\n";
} else {
if ($key == 'corners') {
$style .= $val . "\n";
} else {
if ($key == 'sub_indicator') {
$style .= $val . "\n";
} else {
if ($key == 'sub_padding') {
$padding = explode("px", $val);
$style .= "sub_pad_top=" . $padding[0] . "\n";
$style .= "sub_pad_right=" . $padding[1] . "\n";
$style .= "sub_pad_bottom=" . $padding[2] . "\n";
$style .= "sub_pad_left=" . $padding[3] . "\n";
} else {
if ($key == 'main_padding') {
$padding = explode("px", $val);
$style .= "main_pad_top=" . $padding[0] . "\n";
$style .= "main_pad_right=" . $padding[1] . "\n";
$style .= "main_pad_bottom=" . $padding[2] . "\n";
$style .= "main_pad_left=" . $padding[3] . "\n";
} else {
if ($key == 'complete_padding') {
$padding = explode("px", $val);
$style .= "complete_margin_top=" . $padding[0] . "\n";
$style .= "complete_margin_right=" . $padding[1] . "\n";
$style .= "complete_margin_bottom=" . $padding[2] . "\n";
$style .= "complete_margin_left=" . $padding[3] . "\n";
} else {
if ($key == 'top_margin') {
$padding = explode("px", $val);
$style .= "top_margin_top=" . $padding[0] . "\n";
$style .= "top_margin_right=" . $padding[1] . "\n";
$style .= "top_margin_bottom=" . $padding[2] . "\n";
$style .= "top_margin_left=" . $padding[3] . "\n";
} else {
if ($key == 'main_border') {
$border = explode(" ", $val);
$style .= "main_border_width=" . rtrim(trim($border[0]), 'px') . "\n";
$style .= "main_border_style=" . $border[1] . "\n";
$style .= "main_border_color=" . $border[2] . "\n";
} else {
if ($key == 'main_border_over') {
$border = explode(" ", $val);
$style .= "main_border_over_width=" . rtrim(trim($border[0]), 'px') . "\n";
$style .= "main_border_over_style=" . $border[1] . "\n";
$style .= "main_border_color_over=" . $border[2] . "\n";
} else {
if ($key == 'sub_border') {
$border = explode(" ", $val);
$style .= "sub_border_width=" . rtrim(trim($border[0]), 'px') . "\n";
$style .= "sub_border_style=" . $border[1] . "\n";
$style .= "sub_border_color=" . $border[2] . "\n";
} else {
if ($key == 'sub_border_over') {
$border = explode(" ", $val);
$style .= "sub_border_over_width=" . rtrim(trim($border[0]), 'px') . "\n";
$style .= "sub_border_over_style=" . $border[1] . "\n";
$style .= "sub_border_color_over=" . $border[2] . "\n";
} else {
$style .= $key . "=" . $val . "\n";
}
}
}
}
}
}
}
}
}
}
}
//.........这里部分代码省略.........
示例4: getQueryData
function getQueryData()
{
$query = JRequest::getString('ja_query', '', 'get');
if (!empty($query)) {
$data = new stdClass();
$data->id = 0;
$data->title = '';
$data->query = base64_decode($query);
} else {
$cid = JRequest::getVar('cid', array(0), 'method', 'array');
$id = $cid[0];
$data =& JTable::getInstance('Query', 'Table');
$data->load($id);
$data->query = base64_decode($data->query);
}
return $data;
}
示例5: ajaxStreamAddComment
/**
* Add comment to the stream
*
* @param int $actid acitivity id
* @param string $comment
* @return obj
*/
public function ajaxStreamAddComment($actid, $comment)
{
$filter = JFilterInput::getInstance();
$actid = $filter->clean($actid, 'int');
$comment = $filter->clean($comment, 'string');
$my = CFactory::getUser();
$config = CFactory::getConfig();
$objResponse = new JAXResponse();
$wallModel = CFactory::getModel('wall');
CFactory::load('libraries', 'wall');
CFactory::load('libraries', 'activities');
CFactory::load('helpers', 'friends');
CFactory::load('helper', 'owner');
// Pull the activity record and find out the actor
// only allow comment if the actor is a friend of current user
$act =& JTable::getInstance('Activity', 'CTable');
$act->load($actid);
//who can add comment
$obj = new stdClass();
if ($act->groupid > 0) {
$obj =& JTable::getInstance('Group', 'CTable');
$obj->load($act->groupid);
} else {
if ($act->eventid > 0) {
$obj =& JTable::getInstance('Event', 'CTable');
$obj->load($act->eventid);
}
}
if ($my->authorise('community.add', 'activities.comment.' . $act->actor, $obj)) {
$table =& JTable::getInstance('Wall', 'CTable');
$table->type = $act->comment_type;
$table->contentid = $act->comment_id;
$table->post_by = $my->id;
$table->comment = $comment;
$table->store();
$cache = CFactory::getFastCache();
$cache->clean(array('activities'));
$comment = CWall::formatComment($table);
$objResponse->addScriptCall('joms.miniwall.insert', $actid, $comment);
} else {
// Cannot comment on non-friend stream.
$objResponse->addAlert('Permission denied');
}
return $objResponse->sendResponse();
}