src/Model/Variation/AttributeType.php
public function convertArrayToValues(array $values)
    {
        $set = ArrayList::create();
        foreach ($values as $value) {
            $val = $this->Values()->find('Value', $value);
            if (!$val) {  //TODO: ignore case, if possible
                $val = AttributeValue::create();
                $val->Value = $value;
                $val->TypeID = $this->ID;
                $val->write();
            }
            $set->push($val);
        }

        return $set;
    }
public function convertArrayToValues(array $values)
    {
        $set = ArrayList::create();
        foreach ($values as $value) {
            $val = $this->Values()->find('Value', $value);
            if (!$val) {  //TODO: ignore case, if possible
                $val = AttributeValue::create();
                $val->Value = $value;
                $val->TypeID = $this->ID;
                $val->write();
            }
            $set->push($val);
        }

        return $set;
    }
Finds or creates values for this type.

@param array $values

@return ArrayList