模块/模型/SomeModel.php
public function loadByAttributes($attributes)
{
    $this->setData($this->getResource()->loadByAttributes($attributes));
    return $this;
}
模块/模型/资源/SomeModel.php:
public function loadByAttributes($attributes)
    {
        $adapter = $this->_getReadAdapter();
        $where   = array();
        foreach ($attributes as $attributeCode=> $value) {
            $where[] = sprintf('%s=:%s', $attributeCode, $attributeCode);
        }
        $select = $adapter->select()
            ->from($this->getMainTable())
            ->where(implode(' AND ', $where));
        $binds = $attributes;
        return $adapter->fetchRow($select, $binds);
    }
最后,您可以加载以下模型:
$attributes = array('tag_name'=> 'any', 'custome_name'=> 'some','group_name'=>'some');
$model      = Mage::getModel('module/somemodel')->loadByAttributes($attributes);
更新
顺便说一句,您可以轻松地使用此(loadByAttributes)方法,而不是使用它,这更易于理解。Magento还会在加载集合或实体时调度一些事件,并且第三方扩展可以由观察者更新集合或实体。如果您通过资源(以我和您的示例为例)加载实体,则不会触发任何事件/观察者,并且您可以更快地获得“干净”的实体,而不是进行收集。Magento也不通过这种方式使用缓存的集合,而是直接从db表中加载它。
也许这就是Magento核心模块使用此方法的原因。