示例#1
0
 /**
  * Apply configuration specific for different element type
  *
  * @param string $inputType
  * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
  * @param \Magento\Eav\Model\Entity\Attribute $attribute
  * @return void
  */
 protected function _applyTypeSpecificConfig($inputType, $element, \Magento\Eav\Model\Entity\Attribute $attribute)
 {
     switch ($inputType) {
         case 'select':
             $element->setValues($attribute->getSource()->getAllOptions(true, true));
             break;
         case 'multiselect':
             $element->setValues($attribute->getSource()->getAllOptions(false, true));
             $element->setCanBeEmpty(true);
             break;
         case 'date':
             $element->setDateFormat($this->_localeDate->getDateFormatWithLongYear());
             break;
         case 'multiline':
             $element->setLineCount($attribute->getMultilineCount());
             break;
         default:
             break;
     }
 }