Studyon Minte9.com
ZF 1.0

Study

Reset sql



The reset() method enables you to clear one specified part of the SQL query

// model (extends Zend_Db_Table)

...
$sql->where('t2.id = ?', $id);
$data = $this->fetchRow($sql);

if (!count($data)) {
	$sql->reset(Zend_Db_Select::WHERE);
}

$sql->where('t2.id IS NOT NULL');
$data = $this->fetchRow($sql);


http://framework.zend.com/manual/en/zend.db.select.html#zend.db.select.other.reset