public function getFieldName(Attribute $attribute, $mode = null)
{
$type = (int) $attribute->type;
if ($type === Attribute::TYPE_SHORT_TEXT) {
return sprintf($this->stringTemplate, $attribute->name);
}
if ($type === Attribute::TYPE_CHECKBOX) {
return sprintf($this->checkboxTemplate, $attribute->name);
}
if ($type === Attribute::TYPE_NUMBER) {
return sprintf($this->numberTemplate, $attribute->name, $mode);
}
return null;
}