Hallo!
Bin gerade fast am Ende meiner Komponentenentwicklung angekommen aber habe noch ein Problem.
Wenn ich einen Eintrag aus einer Liste eines Controllers lösche, funktioniert das bei mir z.Zt. so im Model:
Nun habe ich allerdings das "Problem", dass nicht nur aus der einen Tabelle Daten gelöscht werden sollen, sondern auch aus anderen Tabllen.Code:function delete() { $cids = JRequest::getVar( 'cid', array(0), 'post', 'array' ); $row =& $this->getTable(); if (count( $cids )) { foreach($cids as $cid) { if (!$row->delete( $cid )) { $this->setError( $row->getErrorMsg() ); return false; } } } return true; }
Wie stelle ich das am besten an?
Würde es so funktionieren:
Code:function delete() { $cids = JRequest::getVar( 'cid', array(0), 'post', 'array' ); $row =& $this->getTable(); if (count( $cids )) { foreach($cids as $cid) { if (!$row->delete( $cid )) { $this->setError( $row->getErrorMsg() ); return false; } $query = ' DELETE FROM xxxx WHERE id = '.$cid; $this->_db->setQuery( $query ); } } return true; }


LinkBack URL
About LinkBacks
Zitieren
Lesezeichen