/** * Overwrite the creation of the delete SQL statement * to use the foreign key for deletion in language table. * @see API/MODELS/SF_MODEL_AbstractSqlItem#_getDeleteSql($tablename, $fields, $where, $foreignkey) */ protected function _getDeleteSql($tablename, $where, $foreignkey = '') { if ($tablename == $this->table_directory_lang) { $foreignkey = 'iddirectory'; } $sql = parent::_getDeleteSql($tablename, $where, $foreignkey); //echo $sql."<br />"; return $sql; }