public function getCMSFields()
{
$fields = FieldList::create(TextField::create("Name", _t('ProductAttributeType.db_Name', 'Name')), TextField::create("Label", _t('ProductAttributeType.db_Label', 'Label')));
if ($this->isInDB()) {
$fields->push(GridField::create("Values", _t('ProductAttributeType.has_many_Values', "Values"), $this->Values(), GridFieldConfig_RecordEditor::create()));
} else {
$fields->push(LiteralField::create("Values", '<p class="message warning">' . _t('ProductAttributeType.SaveFirstInfo', 'Save first, then you can add values.') . '</p>'));
}
$this->extend('updateCMSFields', $fields);
return $fields;
}