Try the Demo

Magento

eCommerce Software for Online Growth

Magento Forum

Our new hosted solution for small & emerging businesses
   
How to Query Custom Module Resource Table
 
jwpadgett
Member
 
Total Posts:  69
Joined:  2007-09-05
 

Hello, All!

I have a working module that is extremely slow because I’m having to get my model’s resource as a collection then iterate through the values each time I want to get a specific row.

My module uses a custom resource entity that is just a standard table with 4 columns:
id
customer_id
sku_id
price

I need to query the table by customer_id, sku_id. I know this has to be possible, but I can’t find any examples. Anybody have some incite?

 
Magento Community Magento Community
Magento Community
Magento Community
 
srinigenie
Guru
 
Avatar
Total Posts:  539
Joined:  2008-02-04
 

You may have a look at the core class \’Mage_Sales_Model_Mysql4_Quote\’->loadByCustomerId. This loads all the sales quotes of a particular customer. Should give you some idea of how to do it.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top
 
© Copyright 2012 Magento Inc.
Privacy Policy|Terms of Service
Magento Community Count
701238 users|928 users currently online|497292 forum posts