public function toDialectString(Dialect $dialect) { Assert::isTrue($this->targets !== array(), 'do not know who should i truncate'); if ($dialect->hasTruncate()) { $head = 'TRUNCATE TABLE '; } else { $head = 'DELETE FROM '; } if ($dialect->hasMultipleTruncate()) { $query = $head . $this->dumpTargets($dialect, null, ','); } else { $query = $this->dumpTargets($dialect, $head, ';'); } return $query . ';'; }