I am trying to return a collection of brands in Magento that are grouped by the first letter of the title attribute. I have this but it results in a 500 error on the page in question:
public function getBrandGroupedCollection()
{
$brandsCollection = Mage::getModel('shopbybrand/brand')->getCollection();
$brandsCollection
->addStatusFilter()
->setOrder('title', 'asc')
;
$brandsCollection->getSelect()->group(substr('title',0,1));
return $brandsCollection;
}
How can I group the results by the first letter of the "title" attribute?