public function getDropDownField($emptystring = null, $values = null)
{
$values = $values ? $values : $this->Values('', 'Sort ASC, Value ASC');
if ($values->exists()) {
$field = DropdownField::create('ProductAttributes[' . $this->ID . ']', $this->Name, $values->map('ID', 'Value'));
if ($emptystring) {
$field->setEmptyString($emptystring);
}
return $field;
}
return null;
}