public static function build($component, array $options = array())
{
if (is_array($component)) {
return "(\n" . implode(",\n", $component) . "\n)";
} else {
if ($component->isSubpartition) {
return trim('SUBPARTITION ' . $component->name . ' ' . $component->options);
} else {
$subpartitions = empty($component->subpartitions) ? '' : ' ' . PartitionDefinition::build($component->subpartitions);
return trim('PARTITION ' . $component->name . (empty($component->type) ? '' : ' VALUES ' . $component->type . ' ' . $component->expr . ' ') . $component->options . $subpartitions);
}
}
}