Created
February 21, 2013 17:37
-
-
Save steve-ross/5006574 to your computer and use it in GitHub Desktop.
magento select *...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ids = Mage::getModel('catalog/product') | |
->getCollection() | |
->addAttributeToSelect('entity_id') | |
->addFieldToFilter('status', array('eq'=>'1')) | |
->addFieldToFilter('type_id', array('in'=>array('configurable', 'simple'))) | |
->getSelect(); | |
produces: | |
string 'SELECT `e`.*, `at_status`.`value` AS `status` FROM `catalog_product_entity` AS `e` | |
INNER JOIN `catalog_product_entity_int` AS `at_status` ON (`at_status`.`entity_id` = `e`.`entity_id`) AND (`at_status`.`attribute_id` = '96') AND (`at_status`.`store_id` = 0) WHERE (at_status.value = '1') AND (`e`.`type_id` IN('configurable', 'simple'))' (length=337) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment