public function addFieldToFilter($attribute, $condition = null) { if ($attribute == 'name') { $this->getSelect()->where($this->_getConditionSql('t.name', $condition)); return $this; } else { return parent::addFieldToFilter($attribute, $condition); } }
public function addFieldToFilter($attribute, $condition = null) { if ($attribute == 'name') { $where = $this->_getConditionSql('t.name', $condition); $this->getSelect()->where($where, null, Varien_Db_Select::TYPE_CONDITION); return $this; } else { return parent::addFieldToFilter($attribute, $condition); } }