/**
* Generate comment
*
* @param string $crlf Carriage return character
* @param string $sql_statement SQL statement
* @param string $comment1 Comment for dumped table
* @param string $comment2 Comment for current table
* @param string $table_alias Table alias
* @param string $compat Compatibility mode
*
* @return string
*/
protected function generateComment($crlf, $sql_statement, $comment1, $comment2, $table_alias, $compat)
{
if (!isset($sql_statement)) {
if (isset($GLOBALS['no_constraints_comments'])) {
$sql_statement = '';
} else {
$sql_statement = $crlf . $this->_exportComment() . $this->_exportComment($comment1) . $this->_exportComment();
}
}
// comments for current table
if (!isset($GLOBALS['no_constraints_comments'])) {
$sql_statement .= $crlf . $this->_exportComment() . $this->_exportComment($comment2 . ' ' . Util::backquoteCompat($table_alias, $compat, isset($GLOBALS['sql_backquotes']))) . $this->_exportComment();
}
return $sql_statement;
}