• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Varien_Object类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Varien_Object的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Object类的具体用法?PHP Varien_Object怎么用?PHP Varien_Object使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Varien_Object类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: beforeSave

 /**
  * Set new increment id
  *
  * @param Varien_Object $object
  * @return Mage_Eav_Model_Entity_Attribute_Backend_Increment
  */
 public function beforeSave($object)
 {
     if (!$object->getId()) {
         $this->getAttribute()->getEntity()->setNewIncrementId($object);
     }
     return $this;
 }
开发者ID:Airmal,项目名称:Magento-Em,代码行数:13,代码来源:Increment.php


示例2: _prepareForm

 protected function _prepareForm()
 {
     $form = new Varien_Data_Form(array('id' => 'edit_form', 'action' => $this->getData('action'), 'method' => 'post'));
     $form->setHtmlIdPrefix("template");
     $form->setFieldNameSuffix("template");
     /* @var $template Mzax_Emarketing_Model_Template */
     $template = Mage::registry('current_template');
     if ($template->getId()) {
         $form->addField('template_id', 'hidden', array('name' => 'template_id', 'value' => $template->getId()));
     }
     $fieldset = $form->addFieldset('base_fieldset', array('legend' => $this->__('Template Option'), 'class' => 'fieldset-wide'))->addType('editor', Mage::getConfig()->getModelClassName('mzax_emarketing/form_element_templateEditor'))->addType('credits', Mage::getConfig()->getModelClassName('mzax_emarketing/form_element_credits'));
     $fieldset->addField('credits', 'credits', array('name' => 'credits', 'required' => true));
     $fieldset->addField('name', 'text', array('name' => 'name', 'required' => true, 'label' => $this->__('Template Name'), 'title' => $this->__('Template Name')));
     $fieldset->addField('description', 'textarea', array('name' => 'description', 'required' => true, 'label' => $this->__('Description'), 'title' => $this->__('Description'), 'style' => 'height:4em;', 'note' => "For internal use only"));
     $snippets = new Mzax_Emarketing_Model_Medium_Email_Snippets();
     Mage::getSingleton('mzax_emarketing/medium_email')->prepareSnippets($snippets);
     $editorConfig = new Varien_Object();
     $editorConfig->setFilesBrowserWindowUrl($this->getUrl('adminhtml/cms_wysiwyg_images/index'));
     $editorConfig->setWidgetWindowUrl($this->getUrl('adminhtml/widget/index'));
     $editorConfig->setSnippets($snippets);
     $editor = $fieldset->addField('body', 'editor', array('name' => 'body', 'required' => true, 'label' => $this->__('Template HTML'), 'title' => $this->__('Template HTML'), 'logo' => $this->getSkinUrl('images/logo.gif'), 'fullscreen_title' => $this->__('Template %s', $template->getName()), 'style' => 'height:50em;', 'value' => '', 'config' => $editorConfig));
     // Setting custom renderer for content field to remove label column
     $renderer = $this->getLayout()->createBlock('adminhtml/widget_form_renderer_fieldset_element')->setTemplate('cms/page/edit/form/renderer/content.phtml');
     $editor->setRenderer($renderer);
     $form->addValues($template->getData());
     $this->setForm($form);
     $form->setUseContainer(true);
     return parent::_prepareForm();
 }
开发者ID:jsiefer,项目名称:emarketing,代码行数:29,代码来源:Form.php


示例3: validate

 /**
  * validate
  *
  * @param Varien_Object $object Quote
  * @return boolean
  */
 public function validate(Varien_Object $object)
 {
     $all = $this->getAggregator() === 'all';
     $true = (bool) $this->getValue();
     $found = false;
     foreach ($object->getAllItems() as $item) {
         $found = $all;
         foreach ($this->getConditions() as $cond) {
             $validated = $cond->validate($item);
             if ($all && !$validated || !$all && $validated) {
                 $found = $validated;
                 break;
             }
         }
         if ($found && $true || !$true && $found) {
             break;
         }
     }
     // found an item and we're looking for existing one
     if ($found && $true) {
         return true;
     } elseif (!$found && !$true) {
         return true;
     }
     return false;
 }
开发者ID:nemphys,项目名称:magento2,代码行数:32,代码来源:Found.php


示例4: isCategoryActive

 /**
  * Get active status of category
  *
  * @param   Varien_Object $category
  * @return  bool
  */
 function isCategoryActive($category)
 {
     if ($this->getCurrentCategory()) {
         return in_array($category->getId(), $this->getCurrentCategory()->getPathIds());
     }
     return false;
 }
开发者ID:ngagestudios,项目名称:Vehicle-Fits-Magento,代码行数:13,代码来源:Result.php


示例5: validate

 /**
  * Validate attribute data
  *
  * @param Varien_Object $object
  * @return boolean
  */
 public function validate($object)
 {
     // all attribute's options
     $optionsAllowed = array('0', '1', '2');
     $value = $object->getData($this->getAttribute()->getAttributeCode());
     return in_array($value, $optionsAllowed) ? true : false;
 }
开发者ID:evinw,项目名称:project_bloom_magento,代码行数:13,代码来源:Config.php


示例6: render

 /**
  * Renders Purchases value
  *
  * @param   Varien_Object $row
  * @return  string
  */
 public function render(Varien_Object $row)
 {
     if (($value = $row->getData($this->getColumn()->getIndex())) > 0) {
         return $value;
     }
     return $this->__('Unlimited');
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:13,代码来源:Purchases.php


示例7: initControllerRouters

 /**
  *
  */
 public function initControllerRouters($observer)
 {
     $request = $observer->getEvent()->getFront()->getRequest();
     $identifier = trim($request->getPathInfo(), '/');
     $condition = new Varien_Object(array('identifier' => $identifier, 'continue' => true));
     Mage::dispatchEvent('brand_controller_router_match_before', array('router' => $this, 'condition' => $condition));
     $identifier = $condition->getIdentifier();
     if ($condition->getRedirectUrl()) {
         Mage::app()->getFrontController()->getResponse()->setRedirect($condition->getRedirectUrl())->sendResponse();
         $request->setDispatched(true);
         return true;
     }
     if (!$condition->getContinue()) {
         return false;
     }
     $route = trim(Mage::getStoreConfig('ves_brand/general_setting/route'));
     if ($identifier) {
         if (preg_match("#^" . $route . "(\\.html)?\$#", $identifier, $match)) {
             $request->setModuleName('venusbrand')->setControllerName('brand')->setActionName('index');
             $request->setAlias(Mage_Core_Model_Url_Rewrite::REWRITE_REQUEST_PATH_ALIAS, $identifier);
             return true;
         }
         return true;
     }
     return false;
 }
开发者ID:booklein,项目名称:bookle,代码行数:29,代码来源:Observer.php


示例8: getWysiwygPluginSettings

 /**
  * Prepare variable wysiwyg config
  *
  * @param Varien_Object $config
  * @return array
  */
 public function getWysiwygPluginSettings($config)
 {
     $configPlugins = $config->getData('plugins');
     $configPlugins[0]['options']['url'] = $this->getVariablesWysiwygActionUrl();
     $configPlugins[0]['options']['onclick']['subject'] = 'MagentovariablePlugin.loadChooser(\'' . $this->getVariablesWysiwygActionUrl() . '\', \'{{html_id}}\');';
     return $configPlugins;
 }
开发者ID:xiaoguizhidao,项目名称:mydigibits,代码行数:13,代码来源:Config.php


示例9: _prepareData

 /**
  * @param null|Varien_Object $dataObject
  * @return Xcom_Xfabric_Model_Message_Request
  */
 public function _prepareData(Varien_Object $dataObject = null)
 {
     $avroDataObject = Mage::getModel('xcom_chronicle/message_product', $dataObject->getProduct());
     $data = array('products' => array($avroDataObject->toArray()));
     $this->setMessageData($data);
     return parent::_prepareData($dataObject);
 }
开发者ID:ridhoq,项目名称:mxpi-twitter,代码行数:11,代码来源:Outbound.php


示例10: getCategoryRequestPath

 /**
  * Get unique category request path
  *
  * @param Varien_Object $category
  * @param string $parentPath
  * @return string
  */
 public function getCategoryRequestPath($category, $parentPath)
 {
     $storeId = $category->getStoreId();
     $idPath = $this->generatePath('id', null, $category);
     $suffix = $this->getCategoryUrlSuffix($storeId);
     if (isset($this->_rewrites[$idPath])) {
         $this->_rewrite = $this->_rewrites[$idPath];
         $existingRequestPath = $this->_rewrites[$idPath]->getRequestPath();
     }
     if ($category->getUrlKey() == '') {
         $urlKey = $this->getCategoryModel()->formatUrlKey($category->getName());
     } else {
         $urlKey = $this->getCategoryModel()->formatUrlKey($category->getUrlKey());
     }
     $categoryUrlSuffix = $this->getCategoryUrlSuffix($category->getStoreId());
     if (null === $parentPath) {
         $parentPath = $this->getResource()->getCategoryParentPath($category);
     } elseif ($parentPath == '/') {
         $parentPath = '';
     }
     $parentPath = Mage::helper('catalog/category')->getCategoryUrlPath($parentPath, true, $category->getStoreId());
     // Only filter category URL paths when not in B2B store.
     if (Mage::helper("mey_b2b")->getStoreId() != $storeId) {
         $parentPath = $this->_filterCategoriesFromRequestPath($parentPath);
     }
     $requestPath = $parentPath . $urlKey . $categoryUrlSuffix;
     if (isset($existingRequestPath) && $existingRequestPath == $requestPath . $suffix) {
         return $existingRequestPath;
     }
     if ($this->_deleteOldTargetPath($requestPath, $idPath, $storeId)) {
         return $requestPath;
     }
     return $this->getUnusedPath($category->getStoreId(), $requestPath, $this->generatePath('id', null, $category));
 }
开发者ID:jronatay,项目名称:ultimo-magento-jron,代码行数:41,代码来源:Url.php


示例11: assign

 /**
  * Factory method to get proper action instance
  *
  * @param array $config
  * @throws \Exception
  */
 public function assign(array $config)
 {
     $action = $parameters = NULL;
     if (!isset($config[self::F_PARAMETERS]) && sizeof($config) >= 2) {
         $parameters = array_pop($config);
         if (!is_array($parameters)) {
             $parameters = (array) $parameters;
         }
     } elseif (isset($config[self::F_PARAMETERS])) {
         $parameters = $config[self::F_PARAMETERS];
     }
     $action = (string) array_shift($config);
     if (NULL === $action || NULL === $parameters) {
         throw new \Exception(sprintf('Invalid action entry - %s', var_export($config, TRUE)));
     }
     $raw = $action;
     list($scope, $action) = explode('/', $raw, 2);
     // drop all hard spaces
     $action = str_replace('_', '', $action);
     // unlike Mage::helper() this one returns FALSE when model is not found
     // change whole config to use new action name and remove this ugly hack
     // we can't have default namespace, but in config we have such entry
     $scope = $scope == 'default' ? $scope . 'scope' : $scope;
     $className = '\\Nexway\\SetupManager\\Util\\Processor\\Action\\' . ucfirst($scope) . '\\' . ucfirst($action);
     $base = new $className();
     if (FALSE === $base) {
         throw new \Exception(sprintf('Invalid action - %s/%s', $scope, $action));
     }
     $parametersObject = new \Varien_Object();
     $parametersObject->setData($parameters);
     return $base->setAction($action)->setScope($scope)->setParameters($parametersObject);
 }
开发者ID:pawlik,项目名称:magerun-addons,代码行数:38,代码来源:Action.php


示例12: beforeSave

 /**
  * Method is invoked before save
  *
  * @param Varien_Object $object
  * @return Mage_Eav_Model_Entity_Attribute_Backend_Abstract
  */
 public function beforeSave($object)
 {
     if ($object->getCreditmemo()) {
         $object->setParentId($object->getCreditmemo()->getId());
     }
     return parent::beforeSave($object);
 }
开发者ID:par-orillonsoft,项目名称:magento_work,代码行数:13,代码来源:Child.php


示例13: _prepareForm

 /**
  * prepare tab form's information
  *
  * @return Magestore_RewardPoints_Block_Adminhtml_Spending_Edit_Tab_Form
  */
 protected function _prepareForm()
 {
     $form = new Varien_Data_Form();
     if (Mage::getSingleton('adminhtml/session')->getFormData()) {
         $data = Mage::getSingleton('adminhtml/session')->getFormData();
         Mage::getSingleton('adminhtml/session')->setFormData(null);
     } elseif (Mage::registry('rate_data')) {
         $data = Mage::registry('rate_data')->getData();
     }
     $fieldset = $form->addFieldset('rewardpoints_form', array('legend' => Mage::helper('rewardpoints')->__('Rate information')));
     $dataObj = new Varien_Object($data);
     $data = $dataObj->getData();
     $fieldset->addField('points', 'text', array('label' => Mage::helper('rewardpoints')->__('Spending Point(s)'), 'title' => Mage::helper('rewardpoints')->__('Spending Point(s)'), 'required' => true, 'name' => 'points'));
     $fieldset->addField('money', 'text', array('name' => 'money', 'label' => Mage::helper('rewardpoints')->__('Discount received'), 'title' => Mage::helper('rewardpoints')->__('Discount received'), 'required' => true, 'after_element_html' => '<strong>[' . Mage::getStoreConfig(Mage_Directory_Model_Currency::XML_PATH_CURRENCY_BASE) . ']</strong>', 'note' => Mage::helper('rewardpoints')->__('the equivalent value of points')));
     //Hai.Tran 12/11/2013 fix gioi han spend points
     $fieldset->addField('max_price_spended_type', 'select', array('label' => Mage::helper('rewardpoints')->__('Limit spending points based on'), 'title' => Mage::helper('rewardpoints')->__('Limit spending points based on'), 'name' => 'max_price_spended_type', 'options' => array('none' => Mage::helper('rewardpoints')->__('None'), 'by_price' => Mage::helper('rewardpoints')->__('A fixed amount of Total Order Value'), 'by_percent' => Mage::helper('rewardpoints')->__('A percentage of Total Order Value')), 'onchange' => 'toggleMaxPriceSpend()', 'note' => Mage::helper('rewardpoints')->__('Select the type to limit spending points')));
     $fieldset->addField('max_price_spended_value', 'text', array('label' => Mage::helper('rewardpoints')->__('Limit value allowed to spend points at'), 'title' => Mage::helper('rewardpoints')->__('Limit value allowed to spend points at'), 'name' => 'max_price_spended_value', 'note' => Mage::helper('rewardpoints')->__('If empty or zero, there is no limitation.')));
     //End Hai.Tran 12/11/2013
     if (!Mage::app()->isSingleStoreMode()) {
         $fieldset->addField('website_ids', 'multiselect', array('name' => 'website_ids[]', 'label' => Mage::helper('rewardpoints')->__('Websites'), 'title' => Mage::helper('rewardpoints')->__('Websites'), 'required' => true, 'values' => Mage::getSingleton('adminhtml/system_config_source_website')->toOptionArray()));
     } else {
         $fieldset->addField('website_ids', 'hidden', array('name' => 'website_ids[]', 'value' => Mage::app()->getStore(true)->getWebsiteId()));
         $data['website_ids'] = Mage::app()->getStore(true)->getWebsiteId();
     }
     $fieldset->addField('customer_group_ids', 'multiselect', array('label' => Mage::helper('rewardpoints')->__('Customer groups'), 'title' => Mage::helper('rewardpoints')->__('Customer groups'), 'name' => 'customer_group_ids', 'required' => true, 'values' => Mage::getResourceModel('customer/group_collection')->addFieldToFilter('customer_group_id', array('gt' => 0))->load()->toOptionArray()));
     $fieldset->addField('sort_order', 'text', array('label' => Mage::helper('rewardpoints')->__('Priority'), 'label' => Mage::helper('rewardpoints')->__('Priority'), 'required' => false, 'name' => 'sort_order', 'note' => Mage::helper('rewardpoints')->__('Higher priority Rate will be applied first')));
     $form->setValues($data);
     $this->setForm($form);
     Mage::dispatchEvent('rewardpoints_adminhtml_spending_rate_form', array('tab_form' => $this, 'form' => $form, 'data' => $dataObj));
     return parent::_prepareForm();
 }
开发者ID:kanotest15,项目名称:cbmagento,代码行数:36,代码来源:Form.php


示例14: render

 public function render(Varien_Object $value)
 {
     $code = $value->getData('item_value/code');
     $item = $value->getItem();
     $result = '';
     $itemRenderer = $this->getItemRendererBlock();
     if ($code !== '') {
         if ($code == 'name') {
             $result = $this->htmlEscape($item->getName());
         } elseif ($code == 'sku') {
             $result = implode('<br />', Mage::helper('catalog')->splitSku($this->htmlEscape($item->getSku())));
         } elseif ($code == 'quantity') {
             if ($value->hasOrder()) {
                 $result = $itemRenderer->getColumnHtml($item, 'qty');
             } else {
                 $result = $item->getQty() * 1;
             }
         } elseif ($code == 'original_price' || $code == 'tax_amount' || $code == 'discount_amount') {
             $result = $itemRenderer->displayPriceAttribute($code);
         } elseif ($code == 'tax_percent') {
             $result = $itemRenderer->displayTaxPercent($item);
         } elseif ($code == 'row_total') {
             if (Mage::helper('customgrid')->isMageVersionLesserThan(1, 6)) {
                 $result = $itemRenderer->displayPrices($item->getBaseRowTotal() - $item->getBaseDiscountAmount() + $item->getBaseTaxAmount() + $item->getBaseWeeeTaxAppliedRowAmount(), $item->getRowTotal() - $item->getDiscountAmount() + $item->getTaxAmount() + $item->getWeeeTaxAppliedRowAmount());
             } else {
                 $result = $itemRenderer->displayPrices($item->getBaseRowTotal() + $item->getBaseTaxAmount() + $item->getBaseHiddenTaxAmount() + $item->getBaseWeeeTaxAppliedRowAmount() - $item->getBaseDiscountAmount(), $item->getRowTotal() + $item->getTaxAmount() + $item->getHiddenTaxAmount() + $item->getWeeeTaxAppliedRowAmount() - $item->getDiscountAmount());
             }
         } else {
             $result = $item->getDataUsingMethod($code);
         }
     }
     return $result;
 }
开发者ID:xiaoguizhidao,项目名称:blingjewelry-prod,代码行数:33,代码来源:Default.php


示例15: load

 public function load($printQuery = false, $logQuery = false)
 {
     $this->_select = $this->_read->select();
     $entityTable = $this->getEntity()->getEntityTable();
     $paidTable = $this->getAttribute('grand_total')->getBackend()->getTable();
     $idField = $this->getEntity()->getIdFieldName();
     $this->getSelect()->from(array('sales' => $entityTable), array('store_id', 'lifetime' => 'sum(sales.base_grand_total)', 'avgsale' => 'avg(sales.base_grand_total)', 'num_orders' => 'count(sales.base_grand_total)'))->where('sales.entity_type_id=?', $this->getEntity()->getTypeId())->group('sales.store_id');
     if ($this->_customer instanceof Mage_Customer_Model_Customer) {
         $this->getSelect()->where('sales.customer_id=?', $this->_customer->getId());
     }
     $this->printLogQuery($printQuery, $logQuery);
     try {
         $values = $this->_read->fetchAll($this->getSelect()->__toString());
     } catch (Exception $e) {
         $this->printLogQuery(true, true, $this->getSelect()->__toString());
         throw $e;
     }
     $stores = Mage::getResourceModel('core/store_collection')->setWithoutDefaultFilter()->load()->toOptionHash();
     if (!empty($values)) {
         foreach ($values as $v) {
             $obj = new Varien_Object($v);
             $storeName = isset($stores[$obj->getStoreId()]) ? $stores[$obj->getStoreId()] : null;
             $this->_items[$v['store_id']] = $obj;
             $this->_items[$v['store_id']]->setStoreName($storeName);
             $this->_items[$v['store_id']]->setAvgNormalized($obj->getAvgsale() * $obj->getNumOrders());
             foreach ($this->_totals as $key => $value) {
                 $this->_totals[$key] += $obj->getData($key);
             }
         }
         if ($this->_totals['num_orders']) {
             $this->_totals['avgsale'] = $this->_totals['lifetime'] / $this->_totals['num_orders'];
         }
     }
     return $this;
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:35,代码来源:Collection.php


示例16: formatValue

 /**
  * Format total value based on order currency
  *
  * @param   Varien_Object $total
  * @return  string
  */
 public function formatValue($total)
 {
     if (!$total->getIsFormated()) {
         return $this->helper('adminhtml/sales')->displayPrices($this->getOrder(), $total->getBaseValue(), $total->getValue());
     }
     return $total->getValue();
 }
开发者ID:test3metizsoft,项目名称:test,代码行数:13,代码来源:Totals.php


示例17: _getParentTransactionId

 /**
  * Get payflow transaction id from parent transaction
  *
  * @param Varien_Object $payment
  * @return string
  */
 protected function _getParentTransactionId(Varien_Object $payment)
 {
     if ($payment->getParentTransactionId()) {
         return $payment->getTransaction($payment->getParentTransactionId())->getAdditionalInformation(Mage_PaypalUk_Model_Pro::TRANSPORT_PAYFLOW_TXN_ID);
     }
     return $payment->getParentTransactionId();
 }
开发者ID:QiuLihua83,项目名称:magento-enterprise-1.13.1.0,代码行数:13,代码来源:Pro.php


示例18: _getJsonConfig

 public function _getJsonConfig()
 {
     $config = array();
     if (!$this->hasOptions()) {
         return Mage::helper('core')->jsonEncode($config);
     }
     $_request = Mage::getSingleton('tax/calculation')->getRateRequest(false, false, false);
     /* @var $product Mage_Catalog_Model_Product */
     $product = $this->getProduct();
     $_request->setProductClassId($product->getTaxClassId());
     $defaultTax = Mage::getSingleton('tax/calculation')->getRate($_request);
     $_request = Mage::getSingleton('tax/calculation')->getRateRequest();
     $_request->setProductClassId($product->getTaxClassId());
     $currentTax = Mage::getSingleton('tax/calculation')->getRate($_request);
     $_regularPrice = $product->getPrice();
     $_finalPrice = $product->getFinalPrice();
     $_priceInclTax = Mage::helper('tax')->getPrice($product, $_finalPrice, true);
     $_priceExclTax = Mage::helper('tax')->getPrice($product, $_finalPrice);
     $_tierPrices = array();
     $_tierPricesInclTax = array();
     foreach ($product->getTierPrice() as $tierPrice) {
         $_tierPrices[] = Mage::helper('core')->currency($tierPrice['website_price'], false, false);
         $_tierPricesInclTax[] = Mage::helper('core')->currency(Mage::helper('tax')->getPrice($product, (int) $tierPrice['website_price'], true), false, false);
     }
     $config = array('productId' => $product->getId(), 'priceFormat' => Mage::app()->getLocale()->getJsPriceFormat(), 'includeTax' => Mage::helper('tax')->priceIncludesTax() ? 'true' : 'false', 'showIncludeTax' => Mage::helper('tax')->displayPriceIncludingTax(), 'showBothPrices' => Mage::helper('tax')->displayBothPrices(), 'productPrice' => Mage::helper('core')->currency($_finalPrice, false, false), 'productOldPrice' => Mage::helper('core')->currency($_regularPrice, false, false), 'priceInclTax' => Mage::helper('core')->currency($_priceInclTax, false, false), 'priceExclTax' => Mage::helper('core')->currency($_priceExclTax, false, false), 'skipCalculate' => $_priceExclTax != $_priceInclTax ? 0 : 1, 'defaultTax' => $defaultTax, 'currentTax' => $currentTax, 'idSuffix' => '_cloneover', 'oldPlusDisposition' => 0, 'plusDisposition' => 0, 'plusDispositionTax' => 0, 'oldMinusDisposition' => 0, 'minusDisposition' => 0, 'tierPrices' => $_tierPrices, 'tierPricesInclTax' => $_tierPricesInclTax);
     $responseObject = new Varien_Object();
     Mage::dispatchEvent('catalog_product_view_config', array('response_object' => $responseObject));
     if (is_array($responseObject->getAdditionalOptions())) {
         foreach ($responseObject->getAdditionalOptions() as $option => $value) {
             $config[$option] = $value;
         }
     }
     return Mage::helper('core')->jsonEncode($config);
 }
开发者ID:ausger,项目名称:myporto,代码行数:34,代码来源:View.php


示例19: previewAction

 /**
  * This is a straigh copy/paste of
  *
  *   Mage_Catalog_ProductController::viewAction()
  *
  * Only change is that I replaced the $viewHelper so that we could
  * hook into prepareAndRender()
  */
 public function previewAction()
 {
     // Get initial data from request
     $categoryId = (int) $this->getRequest()->getParam('category', false);
     $productId = (int) $this->getRequest()->getParam('id');
     $specifyOptions = $this->getRequest()->getParam('options');
     // Prepare helper and params
     $viewHelper = Mage::helper('tadic_avp/catalog_product_view');
     $params = new Varien_Object();
     $params->setCategoryId($categoryId);
     $params->setSpecifyOptions($specifyOptions);
     // Render page
     try {
         $viewHelper->prepareAndRender($productId, $this, $params);
     } catch (Exception $e) {
         if ($e->getCode() == $viewHelper->ERR_NO_PRODUCT_LOADED) {
             if (isset($_GET['store']) && !$this->getResponse()->isRedirect()) {
                 $this->_redirect('');
             } elseif (!$this->getResponse()->isRedirect()) {
                 $this->_forward('noRoute');
             }
         } else {
             Mage::logException($e);
             $this->_forward('noRoute');
         }
     }
 }
开发者ID:sergeykalenyuk,项目名称:Tadic_AVP,代码行数:35,代码来源:ProductController.php


示例20: render

 /**
  * Renders grid column
  *
  * @param Varien_Object $row
  * @return string
  */
 public function render(Varien_Object $row)
 {
     if ($data = $row->getData($this->getColumn()->getIndex())) {
         if (Mage::app()->getLocale()->getLocale() == 'fa_IR') {
             require_once Mage::getBaseDir('lib') . '/pdate/pdate.php';
             $time = strtotime($data);
             $data = pdate('Y-m-d H:i:s', $time);
         }
         switch ($this->getColumn()->getPeriodType()) {
             case 'month':
                 $dateFormat = 'yyyy-MM';
                 break;
             case 'year':
                 $dateFormat = 'yyyy';
                 break;
             default:
                 $dateFormat = Varien_Date::DATE_INTERNAL_FORMAT;
                 break;
         }
         $format = $this->_getFormat();
         try {
             $data = $this->getColumn()->getGmtoffset() ? Mage::app()->getLocale()->date($data, $dateFormat)->toString($format) : Mage::getSingleton('core/locale')->date($data, Zend_Date::ISO_8601, null, false)->toString($format);
         } catch (Exception $e) {
             $data = $this->getColumn()->getTimezone() ? Mage::app()->getLocale()->date($data, $dateFormat)->toString($format) : Mage::getSingleton('core/locale')->date($data, $dateFormat, null, false)->toString($format);
         }
         return $data;
     }
     return $this->getColumn()->getDefault();
 }
开发者ID:nitronaj,项目名称:magentofa,代码行数:35,代码来源:Date.php



注:本文中的Varien_Object类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Varien_Object_Cache类代码示例发布时间:2022-05-23
下一篇:
PHP Varien_Io_File类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap