You may be looking for the addAttributeToFilter method. eg.
$categories = Mage::getModel('catalog/category')->getCollection()
->addAttributeToSelect('id')
->addAttributeToSelect('name')
->addAttributeToFilter('name',$name);
Then you can work with the returned collection, for example
foreach ($categories as $cat) {
echo 'Name: ' . $cat->getName() . "<br />";
echo 'Category ID: ' . $cat->getId() . "<br />";
}
This works in Magento CE 1.7.0.1, at least.
source
share