Sonata\ProductBundle\Model\BaseProductProvider::getMergedFields PHP Method

getMergedFields() protected method

Checks $fields if specified, returns variation fields otherwise.
protected getMergedFields ( array $fields ) : array
$fields array
return array
    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;
    }