Mage_Reports_Model_Mysql4_Wishlist_Collection Class Reference

Inheritance diagram for Mage_Reports_Model_Mysql4_Wishlist_Collection:

Mage_Core_Model_Mysql4_Collection_Abstract Varien_Data_Collection_Db Varien_Data_Collection

List of all members.

Public Member Functions

 setWishlistTable ($value)
 getWishlistTable ()
 getWishlistCustomerCount ()
 getSharedCount ()

Protected Member Functions

 _construct ()

Protected Attributes

 $wishlistTable


Detailed Description

Definition at line 35 of file Collection.php.


Member Function Documentation

_construct (  )  [protected]

Initialization here

Reimplemented from Mage_Core_Model_Mysql4_Collection_Abstract.

Definition at line 50 of file Collection.php.

00051     {
00052         $this->_init('wishlist/wishlist');
00053         
00054         $this->setWishlistTable(Mage::getSingleton('core/resource')->getTableName('wishlist/wishlist'));
00055     }

getSharedCount (  ) 

Definition at line 73 of file Collection.php.

00074     {          
00075         $collection = Mage::getResourceModel('customer/customer_collection');
00076         $collection->getSelect()->from(array('wt' => $this->getWishlistTable()))
00077                     ->where('wt.customer_id=e.entity_id')
00078                     ->where('wt.shared=1')
00079                     ->group('wt.wishlist_id');
00080         $collection->load();
00081         return $collection->count();
00082     }

getWishlistCustomerCount (  ) 

Definition at line 57 of file Collection.php.

00058     {   
00059         $collection = Mage::getResourceModel('customer/customer_collection');
00060         $collection->load();
00061         
00062         $customers = $collection->count();
00063         
00064         $collection = Mage::getResourceModel('customer/customer_collection');
00065         $collection->getSelect()->from(array('wt' => $this->getWishlistTable()))
00066                     ->where('wt.customer_id=e.entity_id')
00067                     ->group('wt.wishlist_id');
00068         $collection->load();
00069         $count = $collection->count();
00070         return array(($count*100)/$customers, $count);
00071     }

getWishlistTable (  ) 

Definition at line 45 of file Collection.php.

00046     {
00047         return $this->_wishlistTable;
00048     }

setWishlistTable ( value  ) 

Definition at line 39 of file Collection.php.

00040     {
00041         $this->_wishlistTable = $value;
00042         return $this;
00043     }


Member Data Documentation

$wishlistTable [protected]

Definition at line 37 of file Collection.php.


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:24:37 2009 for Magento by  doxygen 1.5.8