getPart(Select::UNION)) { $sql = ''; $parts = count($select->getPart(Select::UNION)); foreach ($select->getPart(Select::UNION) as $cnt => $union) { list($target, $type) = $union; if ($target instanceof Select) { $target = $target->assemble(); } $sql .= $target; if ($cnt < $parts - 1) { $sql .= ' ' . $type . ' '; } } } return $sql; } }