ProductVariation::onBeforeWrite PHP Method

onBeforeWrite() public method

Save selected attributes - somewhat of a hack.
public onBeforeWrite ( )
    public function onBeforeWrite()
    {
        parent::onBeforeWrite();
        if (isset($_POST['ProductAttributes']) && is_array($_POST['ProductAttributes'])) {
            $this->AttributeValues()->setByIDList(array_values($_POST['ProductAttributes']));
        }
    }