Exemple #1
0
 public function toDialectString(Dialect $dialect)
 {
     Assert::isTrue($this->targets !== [], '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 . ';';
 }