Skip to content

Instantly share code, notes, and snippets.

@ceckoslab
Created August 27, 2012 19:20
Show Gist options
  • Save ceckoslab/3491491 to your computer and use it in GitHub Desktop.
Save ceckoslab/3491491 to your computer and use it in GitHub Desktop.
Adding order statement
$collection = Mage::getModel('cms/page')->getCollection();
$collection->addFieldToFilter('identifier', array('in' => $menuIdentifiersArray));
$collection->addFieldToFilter('is_active', 1);
//Add this line
$collection->getSelect()->order("find_in_set(identifier,'".implode(',',$menuIdentifiersArray)."')");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment