当前位置: 首页>>代码示例>>PHP>>正文


PHP Mage::getModel方法代码示例

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


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

示例1: getRatingSummary

 public function getRatingSummary()
 {
     if (!$this->getRatingSummaryCache()) {
         $this->setRatingSummaryCache(Mage::getModel('rating/rating')->getReviewSummary($this->getReviewId()));
     }
     return $this->getRatingSummaryCache();
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:7,代码来源:Summary.php

示例2: setUp

 protected function setUp()
 {
     $this->_product = Mage::getModel('Mage_Catalog_Model_Product');
     $this->_product->load(1);
     $this->_block = Mage::app()->getLayout()->createBlock('Mage_Catalog_Block_Product_View_Type_Configurable');
     $this->_block->setProduct($this->_product);
 }
开发者ID:natxetee,项目名称:magento2,代码行数:7,代码来源:ConfigurableTest.php

示例3: _construct

 /**
  * Initialize template and cache settings
  *
  */
 protected function _construct()
 {
     parent::_construct();
     $this->setTemplate('inventoryplus/menu.phtml');
     $this->_url = Mage::getModel('adminhtml/url');
     $this->setCacheTags(array(self::CACHE_TAGS));
 }
开发者ID:cabrerabywaters,项目名称:magentoSunshine,代码行数:11,代码来源:Menu.php

示例4: _getOptionsCollection

 protected function _getOptionsCollection()
 {
     if (!$this->_collection) {
         $this->_collection = Mage::getModel('emjainteractive_shippingoption/option')->getCollection()->applySortOrder()->load();
     }
     return $this->_collection;
 }
开发者ID:billadams,项目名称:forever-frame,代码行数:7,代码来源:Data.php

示例5: getLinks

 /**
  * Return Purchased link for order item
  *
  * @return Mage_Downloadable_Model_Link_Purchased
  */
 public function getLinks()
 {
     $this->_purchasedLinks = Mage::getModel('downloadable/link_purchased')->load($this->getOrder()->getId(), 'order_id');
     $purchasedItems = Mage::getModel('downloadable/link_purchased_item')->getCollection()->addFieldToFilter('order_item_id', $this->getItem()->getOrderItem()->getId());
     $this->_purchasedLinks->setPurchasedItems($purchasedItems);
     return $this->_purchasedLinks;
 }
开发者ID:ravi2jdesign,项目名称:solvingmagento_1.7.0,代码行数:12,代码来源:Abstract.php

示例6: getCollection

 public function getCollection()
 {
     if (is_null($this->_collection)) {
         $this->setCollection(Mage::getModel('reports/grouped_collection'));
     }
     return $this->_collection;
 }
开发者ID:ksaltik,项目名称:tooldexlive,代码行数:7,代码来源:Abstract.php

示例7: _prepareCollection

 protected function _prepareCollection()
 {
     $model = Mage::getModel('review/review');
     $collection = $model->getProductCollection();
     if ($this->getProductId() || $this->getRequest()->getParam('productId', false)) {
         $productId = $this->getProductId();
         if (!$productId) {
             $productId = $this->getRequest()->getParam('productId');
         }
         $this->setProductId($productId);
         $collection->addEntityFilter($this->getProductId());
     }
     if ($this->getCustomerId() || $this->getRequest()->getParam('customerId', false)) {
         $customerId = $this->getCustomerId();
         if (!$customerId) {
             $customerId = $this->getRequest()->getParam('customerId');
         }
         $this->setCustomerId($customerId);
         $collection->addCustomerFilter($this->getCustomerId());
     }
     if (Mage::registry('usePendingFilter') === true) {
         $collection->addStatusFilter($model->getPendingStatus());
     }
     $collection->addStoreData();
     $this->setCollection($collection);
     return parent::_prepareCollection();
 }
开发者ID:chucky515,项目名称:Magento-CE-Mirror,代码行数:27,代码来源:Grid.php

示例8: __construct

 public function __construct()
 {
     parent::__construct();
     $this->setTemplate('sales/order/details.phtml');
     $this->setOrder(Mage::getModel('sales/order')->load($this->getRequest()->getParam('order_id')));
     Mage::registry('action')->getLayout()->getBlock('root')->setHeaderTitle(Mage::helper('sales')->__('Order Details'));
 }
开发者ID:SalesOneGit,项目名称:s1_magento,代码行数:7,代码来源:Details.php

示例9: __construct

 public function __construct()
 {
     parent::__construct();
     // Initialization block
     //------------------------------
     $this->setId('ebayFeedback');
     $this->_blockGroup = 'M2ePro';
     $this->_controller = 'adminhtml_ebay_feedback';
     //------------------------------
     // Set header text
     //------------------------------
     $accountTitle = '';
     $accountId = $this->getRequest()->getParam('account');
     if (!is_null($accountId)) {
         $accountTitle = Mage::getModel('M2ePro/Account')->load((int) $accountId)->getTitle();
     }
     $this->_headerText = Mage::helper('M2ePro')->__('Feedback for account "%s"', $accountTitle);
     //------------------------------
     // Set buttons actions
     //------------------------------
     $this->removeButton('back');
     $this->removeButton('reset');
     $this->removeButton('delete');
     $this->removeButton('add');
     $this->removeButton('save');
     $this->removeButton('edit');
     $this->_addButton('goto_orders', array('label' => Mage::helper('M2ePro')->__('Orders'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/adminhtml_ebay_order/index') . '\')', 'class' => 'button_link'));
     $this->_addButton('goto_accounts', array('label' => Mage::helper('M2ePro')->__('Accounts'), 'onclick' => 'setLocation(\'' . $this->getUrl('*/adminhtml_ebay_account/index') . '\')', 'class' => 'button_link'));
     $this->_addButton('reset', array('label' => Mage::helper('M2ePro')->__('Refresh'), 'onclick' => 'EbayFeedbackHandlerObj.reset_click()', 'class' => 'reset'));
     //------------------------------
 }
开发者ID:xiaoguizhidao,项目名称:bb,代码行数:31,代码来源:Feedback.php

示例10: ajaxAction

 public function ajaxAction()
 {
     $idItem = Mage::app()->getRequest()->getParam('idItem');
     Mage::register('current_log', Mage::getModel('amaudit/log')->load($idItem));
     $block = $this->getLayout()->createBlock('amaudit/adminhtml_userlog_edit_tab_view_details');
     $this->getResponse()->setBody($block->toHtml());
 }
开发者ID:santhosh400,项目名称:ecart,代码行数:7,代码来源:AjaxController.php

示例11: _prepareForm

 /**
  * Prepare form before rendering HTML
  * Setting Form Fieldsets and fields
  *
  * @return Mage_Adminhtml_Block_Widget_Form
  */
 protected function _prepareForm()
 {
     $form = new Varien_Data_Form();
     $this->setForm($form);
     $data = Mage::helper('xmlconnect')->getApplication()->getFormData();
     $yesNoValues = Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray();
     $fieldset = $form->addFieldset('flurryAnalytics', array('legend' => $this->__('Flurry Analytics')));
     if (isset($data['conf[native][merchantFlurryTracking][isActive]'])) {
         $isActiveValue = $data['conf[native][merchantFlurryTracking][isActive]'];
     } else {
         $isActiveValue = '0';
     }
     $enabled = $fieldset->addField('conf/native/merchantFlurryTracking/isActive', 'select', array('label' => $this->__('Enable Flurry Analytics'), 'name' => 'conf[native][merchantFlurryTracking][isActive]', 'values' => $yesNoValues, 'note' => $this->__('Enable Flurry Analytics for the merchant.'), 'value' => $isActiveValue));
     $flurryAnalyticsUrl = $this->escapeHtml(Mage::getStoreConfig('xmlconnect/flurry_analytics/statistics_url'));
     $fieldset->addField('flurry_analytics_link', 'link', array('title' => $this->__('Flurry Analytics Site'), 'label' => $this->__('Flurry Analytics Site'), 'value' => $flurryAnalyticsUrl, 'href' => $flurryAnalyticsUrl, 'target' => '__blank', 'note' => $this->__('You can watch statistics here.')));
     if (isset($data['conf[native][merchantFlurryTracking][accountId]'])) {
         $accountIdValue = $data['conf[native][merchantFlurryTracking][accountId]'];
     } else {
         $accountIdValue = '';
     }
     $flurryApiCode = $fieldset->addField('conf/native/merchantFlurryTracking/accountId', 'text', array('label' => $this->__('Flurry API Code'), 'name' => 'conf[native][merchantFlurryTracking][accountId]', 'enabled' => true, 'required' => true, 'value' => $accountIdValue));
     // field dependencies
     $this->setChild('form_after', $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence')->addFieldMap($flurryApiCode->getHtmlId(), $flurryApiCode->getName())->addFieldMap($enabled->getHtmlId(), $enabled->getName())->addFieldDependence($flurryApiCode->getName(), $enabled->getName(), 1));
     return parent::_prepareForm();
 }
开发者ID:quyip8818,项目名称:Mag,代码行数:31,代码来源:Flurryanalytics.php

示例12: _beforeToHtml

 protected function _beforeToHtml()
 {
     $account = Mage::helper('M2ePro/Data_Global')->getValue('temp_data');
     $magentoOrdersSettings = $account->getData('magento_orders_settings');
     $magentoOrdersSettings = !empty($magentoOrdersSettings) ? json_decode($magentoOrdersSettings, true) : array();
     // ---------------------------------------
     $temp = Mage::getModel('core/website')->getCollection()->setOrder('sort_order', 'ASC')->toArray();
     $this->websites = $temp['items'];
     // ---------------------------------------
     // ---------------------------------------
     $temp = Mage::getModel('customer/group')->getCollection()->toArray();
     $this->groups = $temp['items'];
     // ---------------------------------------
     // ---------------------------------------
     $selectedStore = !empty($magentoOrdersSettings['listing']['store_id']) ? $magentoOrdersSettings['listing']['store_id'] : '';
     $blockStoreSwitcher = $this->getLayout()->createBlock('M2ePro/adminhtml_storeSwitcher', '', array('id' => 'magento_orders_listings_store_id', 'name' => 'magento_orders_settings[listing][store_id]', 'selected' => $selectedStore));
     $blockStoreSwitcher->hasDefaultOption(false);
     $this->setChild('magento_orders_listings_store_id', $blockStoreSwitcher);
     // ---------------------------------------
     // ---------------------------------------
     $selectedStore = !empty($magentoOrdersSettings['listing_other']['store_id']) ? $magentoOrdersSettings['listing_other']['store_id'] : '';
     $blockStoreSwitcher = $this->getLayout()->createBlock('M2ePro/adminhtml_storeSwitcher', '', array('id' => 'magento_orders_listings_other_store_id', 'name' => 'magento_orders_settings[listing_other][store_id]', 'selected' => $selectedStore));
     $blockStoreSwitcher->hasDefaultOption(false);
     $this->setChild('magento_orders_listings_other_store_id', $blockStoreSwitcher);
     // ---------------------------------------
     // ---------------------------------------
     $productTaxClasses = Mage::getModel('tax/class')->getCollection()->addFieldToFilter('class_type', Mage_Tax_Model_Class::TAX_CLASS_TYPE_PRODUCT)->toOptionArray();
     $none = array('value' => Ess_M2ePro_Model_Magento_Product::TAX_CLASS_ID_NONE, 'label' => 'None');
     array_unshift($productTaxClasses, $none);
     $this->productTaxClasses = $productTaxClasses;
     // ---------------------------------------
     return parent::_beforeToHtml();
 }
开发者ID:giuseppemorelli,项目名称:magento-extension,代码行数:33,代码来源:Order.php

示例13: getSubscriptionObject

 public function getSubscriptionObject()
 {
     if (is_null($this->_subscription)) {
         $this->_subscription = Mage::getModel('newsletter/subscriber')->loadByCustomer($this->getCustomer());
     }
     return $this->_subscription;
 }
开发者ID:hunnybohara,项目名称:magento-chinese-localization,代码行数:7,代码来源:Dashboard.php

示例14: addBlogSection

 public function addBlogSection($observer)
 {
     $sitemapObject = $observer->getSitemapObject();
     if (!$sitemapObject instanceof Mage_Sitemap_Model_Sitemap) {
         throw new Exception(Mage::helper('blog')->__('Error during generation sitemap'));
     }
     $storeId = $sitemapObject->getStoreId();
     $date = Mage::getSingleton('core/date')->gmtDate('Y-m-d');
     $baseUrl = Mage::app()->getStore($storeId)->getBaseUrl(Mage_Core_Model_Store::URL_TYPE_LINK);
     /**
      * Generate blog pages sitemap
      */
     $changefreq = (string) Mage::getStoreConfig('sitemap/blog/changefreq');
     $priority = (string) Mage::getStoreConfig('sitemap/blog/priority');
     $collection = Mage::getModel('blog/blog')->getCollection()->addStoreFilter($storeId);
     Mage::getSingleton('blog/status')->addEnabledFilterToCollection($collection);
     $route = Mage::getStoreConfig('blog/blog/route');
     if ($route == "") {
         $route = "blog";
     }
     foreach ($collection as $item) {
         $xml = sprintf('<url><loc>%s</loc><lastmod>%s</lastmod><changefreq>%s</changefreq><priority>%.1f</priority></url>', htmlspecialchars($baseUrl . $route . '/' . $item->getIdentifier()), $date, $changefreq, $priority);
         $sitemapObject->sitemapFileAddLine($xml);
     }
     unset($collection);
 }
开发者ID:technomagegithub,项目名称:colb2b,代码行数:26,代码来源:Observer.php

示例15: callbackDescription

 public function callbackDescription($value, $row, $column, $isExport)
 {
     $fullDescription = Mage::getModel('M2ePro/Log_Abstract')->decodeDescription($row->getData('description'));
     $row->setData('description', $fullDescription);
     $value = $column->getRenderer()->render($row);
     preg_match_all('/href="([^"]*)"/', $fullDescription, $matches);
     if (!count($matches[0])) {
         return $this->prepareLongText($fullDescription, $value);
     }
     foreach ($matches[1] as $key => $href) {
         preg_match_all('/route:([^;]*)/', $href, $routeMatch);
         preg_match_all('/back:([^;]*)/', $href, $backMatch);
         preg_match_all('/filter:([^;]*)/', $href, $filterMatch);
         if (count($routeMatch[1]) == 0) {
             $fullDescription = str_replace($matches[0][$key], '', $fullDescription);
             $value = str_replace($matches[0][$key], '', $value);
             continue;
         }
         $params = array();
         if (count($backMatch[1]) > 0) {
             $params['back'] = Mage::helper('M2ePro')->makeBackUrlParam($backMatch[1][$key]);
         }
         if (count($filterMatch[1]) > 0) {
             $params['filter'] = base64_encode($filterMatch[1][$key]);
         }
         $url = $routeMatch[1][$key];
         $fullDescription = str_replace($href, $this->getUrl($url, $params), $fullDescription);
         $value = str_replace($href, $this->getUrl($url, $params), $value);
     }
     return $this->prepareLongText($fullDescription, $value);
 }
开发者ID:ashfaqphplhr,项目名称:artificiallawnsforturf,代码行数:31,代码来源:Grid.php


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