protected function getMergedFields(array $fields)
{
if (0 === count($fields)) {
// If we didn't specify the fields (filtered), we get all variation fields possible values
$fields = $this->getVariationFields();
} else {
foreach ($fields as $field) {
if (!in_array($field, $this->getVariationFields())) {
throw new \RuntimeException("The field '" . $field . "' is not among the variation fields");
}
}
}
return $fields;
}