You could do something like this to utilize already built functionality of Zend_Db_Select:
$select = $this->select();
->where('modID = ?', (int)$mid);
->where('URL = ?', $url->toString());
$where = $select->getPart(Zend_Db_Select::WHERE);
$this->delete($where);
Some things to note about this solution:
- (Pro) Takes advantage of the already existing functionality of quoting in Zend_Db_Select
(Pro) Takes advantage of that Zend_Db_Table::delete proxies to the adapter method, so you can provide an array of SQL-parts. From the documentation:
"Since the table delete() method proxies to the database adapter delete() method, the argument can also be an array of SQL expressions. The expressions are combined as Boolean terms using an AND operator."
(Con) Creates a Zend_Db_Select object, but you are really only interested in the where-clause
Even better would be if the delete method would accept a Zend_Db_Select OR perhaps a Zend_Db_Constraint (non-existing class). You could of course make this a Utility-method so that it is available to all your tables, making deletion easier.
Another method is to simply skip the select object:
$where = "{$this->getAdapter()->quoteInto('modID = ?', (int)$mid)} AND
{$this->getAdapter()->quoteInto('URL = ?', $url->toString)}";