Skip to content

Instantly share code, notes, and snippets.

@herveguetin
Created May 26, 2014 22:49
Show Gist options
  • Select an option

  • Save herveguetin/f051a1252b9e2bdca388 to your computer and use it in GitHub Desktop.

Select an option

Save herveguetin/f051a1252b9e2bdca388 to your computer and use it in GitHub Desktop.
Use mySQL expression in Magento collection select
<?php
Mage::getModel('my_model')
->getCollection()
->addAttributeToFilter('my_column', array('gt' => Zend_Db_Expr(MY_EXPRESSION)))
;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment