Overview

Packages

  • currencysymbol
  • MAbout
  • Mage
    • Admin
    • Adminhtml
    • AdminNotification
    • Api
    • Api2
    • Authorizenet
    • Backup
    • Bundle
    • Captcha
    • Catalog
    • CatalogIndex
    • CatalogInventory
    • CatalogRule
    • CatalogSearch
    • Centinel
    • Checkout
    • Cms
    • Compiler
    • Connect
    • Contacts
    • Core
    • Cron
    • CurrencySymbol
    • Customer
    • Dataflow
    • Directory
    • DirtectPost
    • Downloadable
    • Eav
    • GiftMessage
    • GoogleAnalytics
    • GoogleBase
    • GoogleCheckout
    • ImportExport
    • Index
    • Install
    • Log
    • Media
    • Newsletter
    • Oauth
    • Page
    • PageCache
    • Paygate
    • Payment
    • Paypal
    • PaypalUk
    • Persistent
    • Poll
    • ProductAlert
    • Rating
    • Reports
    • Review
    • Rss
    • Rule
    • Sales
    • SalesRule
    • Sedfriend
    • Sendfriend
    • Shipping
    • Sitemap
    • Tag
    • Tax
    • Usa
    • Weee
    • Widget
    • Wishlist
    • XmlConnect
  • None
  • Phoenix
    • Moneybookers
  • PHP
  • Zend
    • Date
    • Mime
    • XmlRpc

Classes

  • Mage_Reports_Block_Product_Abstract
  • Mage_Reports_Block_Product_Compared
  • Mage_Reports_Block_Product_Viewed
  • Mage_Reports_Block_Product_Widget_Compared
  • Mage_Reports_Block_Product_Widget_Viewed
  • Mage_Reports_Exception
  • Mage_Reports_Helper_Data
  • Mage_Reports_Model_Config
  • Mage_Reports_Model_Event
  • Mage_Reports_Model_Event_Observer
  • Mage_Reports_Model_Event_Type
  • Mage_Reports_Model_Flag
  • Mage_Reports_Model_Grouped_Collection
  • Mage_Reports_Model_Mysql4_Accounts_Collection
  • Mage_Reports_Model_Mysql4_Coupons_Collection
  • Mage_Reports_Model_Mysql4_Customer_Collection
  • Mage_Reports_Model_Mysql4_Customer_Orders_Collection
  • Mage_Reports_Model_Mysql4_Customer_Totals_Collection
  • Mage_Reports_Model_Mysql4_Entity_Summary_Collection_Abstract
  • Mage_Reports_Model_Mysql4_Event
  • Mage_Reports_Model_Mysql4_Event_Collection
  • Mage_Reports_Model_Mysql4_Event_Type
  • Mage_Reports_Model_Mysql4_Event_Type_Collection
  • Mage_Reports_Model_Mysql4_Invoiced_Collection
  • Mage_Reports_Model_Mysql4_Order_Collection
  • Mage_Reports_Model_Mysql4_Product_Collection
  • Mage_Reports_Model_Mysql4_Product_Downloads_Collection
  • Mage_Reports_Model_Mysql4_Product_Index_Abstract
  • Mage_Reports_Model_Mysql4_Product_Index_Collection_Abstract
  • Mage_Reports_Model_Mysql4_Product_Index_Compared
  • Mage_Reports_Model_Mysql4_Product_Index_Compared_Collection
  • Mage_Reports_Model_Mysql4_Product_Index_Viewed
  • Mage_Reports_Model_Mysql4_Product_Index_Viewed_Collection
  • Mage_Reports_Model_Mysql4_Product_Lowstock_Collection
  • Mage_Reports_Model_Mysql4_Product_Ordered_Collection
  • Mage_Reports_Model_Mysql4_Product_Sold_Collection
  • Mage_Reports_Model_Mysql4_Product_Viewed_Collection
  • Mage_Reports_Model_Mysql4_Quote_Collection
  • Mage_Reports_Model_Mysql4_Refunded_Collection
  • Mage_Reports_Model_Mysql4_Report_Abstract
  • Mage_Reports_Model_Mysql4_Report_Collection
  • Mage_Reports_Model_Mysql4_Review_Collection
  • Mage_Reports_Model_Mysql4_Review_Customer_Collection
  • Mage_Reports_Model_Mysql4_Review_Product_Collection
  • Mage_Reports_Model_Mysql4_Shipping_Collection
  • Mage_Reports_Model_Mysql4_Tag_Collection
  • Mage_Reports_Model_Mysql4_Tag_Customer_Collection
  • Mage_Reports_Model_Mysql4_Tag_Product_Collection
  • Mage_Reports_Model_Mysql4_Tax_Collection
  • Mage_Reports_Model_Mysql4_Wishlist_Collection
  • Mage_Reports_Model_Mysql4_Wishlist_Product_Collection
  • Mage_Reports_Model_Product_Index_Abstract
  • Mage_Reports_Model_Product_Index_Compared
  • Mage_Reports_Model_Product_Index_Viewed
  • Mage_Reports_Model_Report
  • Mage_Reports_Model_Resource_Accounts_Collection
  • Mage_Reports_Model_Resource_Coupons_Collection
  • Mage_Reports_Model_Resource_Customer_Collection
  • Mage_Reports_Model_Resource_Customer_Orders_Collection
  • Mage_Reports_Model_Resource_Customer_Totals_Collection
  • Mage_Reports_Model_Resource_Entity_Summary_Collection_Abstract
  • Mage_Reports_Model_Resource_Event
  • Mage_Reports_Model_Resource_Event_Collection
  • Mage_Reports_Model_Resource_Event_Type
  • Mage_Reports_Model_Resource_Event_Type_Collection
  • Mage_Reports_Model_Resource_Helper_Mysql4
  • Mage_Reports_Model_Resource_Invoiced_Collection
  • Mage_Reports_Model_Resource_Order_Collection
  • Mage_Reports_Model_Resource_Product_Collection
  • Mage_Reports_Model_Resource_Product_Downloads_Collection
  • Mage_Reports_Model_Resource_Product_Index_Abstract
  • Mage_Reports_Model_Resource_Product_Index_Collection_Abstract
  • Mage_Reports_Model_Resource_Product_Index_Compared
  • Mage_Reports_Model_Resource_Product_Index_Compared_Collection
  • Mage_Reports_Model_Resource_Product_Index_Viewed
  • Mage_Reports_Model_Resource_Product_Index_Viewed_Collection
  • Mage_Reports_Model_Resource_Product_Lowstock_Collection
  • Mage_Reports_Model_Resource_Product_Ordered_Collection
  • Mage_Reports_Model_Resource_Product_Sold_Collection
  • Mage_Reports_Model_Resource_Product_Viewed_Collection
  • Mage_Reports_Model_Resource_Quote_Collection
  • Mage_Reports_Model_Resource_Refunded_Collection
  • Mage_Reports_Model_Resource_Report_Abstract
  • Mage_Reports_Model_Resource_Report_Collection
  • Mage_Reports_Model_Resource_Report_Collection_Abstract
  • Mage_Reports_Model_Resource_Report_Product_Viewed
  • Mage_Reports_Model_Resource_Report_Product_Viewed_Collection
  • Mage_Reports_Model_Resource_Review_Collection
  • Mage_Reports_Model_Resource_Review_Customer_Collection
  • Mage_Reports_Model_Resource_Review_Product_Collection
  • Mage_Reports_Model_Resource_Shipping_Collection
  • Mage_Reports_Model_Resource_Shopcart_Product_Collection
  • Mage_Reports_Model_Resource_Tag_Collection
  • Mage_Reports_Model_Resource_Tag_Customer_Collection
  • Mage_Reports_Model_Resource_Tag_Product_Collection
  • Mage_Reports_Model_Resource_Tax_Collection
  • Mage_Reports_Model_Resource_Wishlist_Collection
  • Mage_Reports_Model_Resource_Wishlist_Product_Collection
  • Mage_Reports_Model_Session
  • Mage_Reports_Model_Test
  • Mage_Reports_Model_Totals

Interfaces

  • Mage_Reports_Model_Resource_Helper_Interface
  • Overview
  • Package
  • Class
  • Tree
  1: <?php
  2: /**
  3:  * Magento
  4:  *
  5:  * NOTICE OF LICENSE
  6:  *
  7:  * This source file is subject to the Open Software License (OSL 3.0)
  8:  * that is bundled with this package in the file LICENSE.txt.
  9:  * It is also available through the world-wide-web at this URL:
 10:  * http://opensource.org/licenses/osl-3.0.php
 11:  * If you did not receive a copy of the license and are unable to
 12:  * obtain it through the world-wide-web, please send an email
 13:  * to license@magentocommerce.com so we can send you a copy immediately.
 14:  *
 15:  * DISCLAIMER
 16:  *
 17:  * Do not edit or add to this file if you wish to upgrade Magento to newer
 18:  * versions in the future. If you wish to customize Magento for your
 19:  * needs please refer to http://www.magentocommerce.com for more information.
 20:  *
 21:  * @category    Mage
 22:  * @package     Mage_Reports
 23:  * @copyright   Copyright (c) 2012 Magento Inc. (http://www.magentocommerce.com)
 24:  * @license     http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 25:  */
 26: 
 27: 
 28: /**
 29:  * Reports Recently Products Abstract Block
 30:  *
 31:  * @category   Mage
 32:  * @package    Mage_Reports
 33:  * @author     Magento Core Team <core@magentocommerce.com>
 34:  */
 35: abstract class Mage_Reports_Block_Product_Abstract extends Mage_Catalog_Block_Product_Abstract
 36: {
 37:     /**
 38:      * Product Index model name
 39:      *
 40:      * @var string
 41:      */
 42:     protected $_indexName;
 43: 
 44:     /**
 45:      * Product Index model instance
 46:      *
 47:      * @var Mage_Reports_Model_Product_Index_Abstract
 48:      */
 49:     protected $_indexModel;
 50: 
 51:     /**
 52:      * Product Index Collection
 53:      *
 54:      * @var Mage_Reports_Model_Mysql4_Product_Index_Collection_Abstract
 55:      */
 56:     protected $_collection;
 57: 
 58:     /**
 59:      * Retrieve page size
 60:      *
 61:      * @return int
 62:      */
 63:     public function getPageSize()
 64:     {
 65:         if ($this->hasData('page_size')) {
 66:             return $this->getData('page_size');
 67:         }
 68:         return 5;
 69:     }
 70: 
 71:     /**
 72:      * Retrieve product ids, that must not be included in collection
 73:      *
 74:      * @return array
 75:      */
 76:     protected function _getProductsToSkip()
 77:     {
 78:         return array();
 79:     }
 80: 
 81:     /**
 82:      * Retrieve Product Index model instance
 83:      *
 84:      * @return Mage_Reports_Model_Product_Index_Abstract
 85:      */
 86:     protected function _getModel()
 87:     {
 88:         if (is_null($this->_indexModel)) {
 89:             if (is_null($this->_indexName)) {
 90:                 Mage::throwException(Mage::helper('reports')->__('Index model name must be defined'));
 91:             }
 92: 
 93:             $this->_indexModel = Mage::getModel($this->_indexName);
 94:         }
 95: 
 96:         return $this->_indexModel;
 97:     }
 98: 
 99:     /**
100:      * Public method for retrieve Product Index model
101:      *
102:      * @return Mage_Reports_Model_Product_Index_Abstract
103:      */
104:     public function getModel()
105:     {
106:         return $this->_getModel();
107:     }
108: 
109:     /**
110:      * Retrieve Index Product Collection
111:      *
112:      * @return Mage_Reports_Model_Resource_Product_Index_Collection_Abstract
113:      */
114:     public function getItemsCollection()
115:     {
116:         if (is_null($this->_collection)) {
117:             $attributes = Mage::getSingleton('catalog/config')->getProductAttributes();
118: 
119:             $this->_collection = $this->_getModel()
120:                 ->getCollection()
121:                 ->addAttributeToSelect($attributes);
122: 
123:                 if ($this->getCustomerId()) {
124:                     $this->_collection->setCustomerId($this->getCustomerId());
125:                 }
126: 
127:                 $this->_collection->excludeProductIds($this->_getModel()->getExcludeProductIds())
128:                     ->addUrlRewrite()
129:                     ->setPageSize($this->getPageSize())
130:                     ->setCurPage(1);
131: 
132:             /* Price data is added to consider item stock status using price index */
133:             $this->_collection->addPriceData();
134: 
135:             $ids = $this->getProductIds();
136:             if (empty($ids)) {
137:                 $this->_collection->addIndexFilter();
138:             } else {
139:                 $this->_collection->addFilterByIds($ids);
140:             }
141:             $this->_collection->setAddedAtOrder();
142: 
143:             Mage::getSingleton('catalog/product_visibility')
144:                 ->addVisibleInSiteFilterToCollection($this->_collection);
145:         }
146: 
147:         return $this->_collection;
148:     }
149: 
150:     /**
151:      * Retrieve count of product index items
152:      *
153:      * @return int
154:      */
155:     public function getCount()
156:     {
157:         if (!$this->_getModel()->getCount()) {
158:             return 0;
159:         }
160:         return $this->getItemsCollection()->count();
161:     }
162: 
163:     /**
164:      * Get products collection and apply recent events log to it
165:      *
166:      * @deprecated
167:      * @return Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection
168:      */
169:     protected function _getRecentProductsCollection()
170:     {
171:         return $this->getItemsCollection();
172:     }
173: }
174: 
Magento 1.7.0.2 API documentation generated by ApiGen 2.8.0