本文整理汇总了PHP中mage::app方法的典型用法代码示例。如果您正苦于以下问题:PHP mage::app方法的具体用法?PHP mage::app怎么用?PHP mage::app使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mage
的用法示例。
在下文中一共展示了mage::app方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processPendingEdits
public function processPendingEdits(&$edit, $sessionId = null, $checkIfExpired = false)
{
/* @var $db Mana_Db_Helper_Data */
$db = Mage::helper('mana_db');
if (!$edit) {
$edit = mage::app()->getRequest()->getParam('edit');
}
if ($edit) {
if (!is_array($edit)) {
$edit = json_decode($edit, true);
}
if (!$sessionId) {
$sessionId = $edit['sessionId'];
}
if (($checkIfExpired || count($edit['pending'])) && $db->isEditingSessionExpired($sessionId)) {
throw new Mage_Core_Exception($db->__('Page editing session is expired. Please reload the page.'));
}
foreach ($edit['pending'] as $id => $cells) {
if (isset($edit['deleted'][$id])) {
continue;
}
if (!($model = $this->loadEditedModel($id, $sessionId))) {
$model = $this->loadModel($id);
} else {
$edit['saved'][$model->getEditStatus()] = $model->getId();
}
$isOriginal = false;
if (!$model->getEditStatus()) {
$isOriginal = true;
$data = $model->getData();
$model = $this->createModel();
$status = $data['id'];
unset($data['id']);
$model->addData($data);
$model->setEditStatus($status)->setEditSessionId($edit['sessionId']);
}
$model->addGridCellData($cells);
$model->save();
if ($isOriginal) {
$edit['saved'][$id] = $model->getId();
}
}
$edit['pending'] = array();
}
return $this;
}
示例2: getAvailabilityMessage
/**
* Return availability message
*
*/
public function getAvailabilityMessage()
{
$storeId = mage::app()->getStore()->getCode();
return mage::helper('purchase/ProductAvailability')->getLabel($storeId, $this->getAverageSupplyDelay());
}
示例3: getDescription
/**
* Show availability description
*
* @param unknown_type $product
*/
public function getDescription($product)
{
$retour = '';
if (!$this->isInStock($product)) {
if ($this->getSupplyDate($product) != null) {
$retour = $this->__('Supply planed on ') . $this->getSupplyDate($product);
} else {
$storeId = mage::app()->getStore()->getCode();
$retour = mage::helper('purchase/ProductAvailability')->getLabel($storeId, $product->getdefault_supply_delay());
}
}
return $retour;
}