I need to delete a record using Zend_Db_Table referencing the rence table. In SQL the query would look like this:
DELETE t1 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.id IS NULL;
Is there a way to do this more elegant than the code below?
$table = new Application_Model_DbTable_T1();
$sql = 'DELETE t1 FROM t1 LEFT JOIN t2 ON t1.id=t2.id WHERE t2.id IS NULL;';
$table->getAdapter()->query($sql);
I found a similar topic and it looks like I should use $table->getAdapter()->query($sql);
but I hope for better.