Esempio n. 1
0
 /**
  * @return void
  */
 protected function initAttributes()
 {
     if (empty($this->attributes)) {
         foreach ($this->config['fields'] as $field) {
             if (isset($field['source']) && $field['source'] == 'eav') {
                 $attribute = $this->dataSet->getEntity()->getAttribute($field['name']);
                 if ($attribute) {
                     $this->attributes[$field['name']] = $attribute->getData();
                     $options = [];
                     if ($attribute->usesSource()) {
                         $options = $attribute->getSource()->getAllOptions();
                     }
                     $this->attributes[$field['name']]['options'] = $options;
                     $this->attributes[$field['name']]['is_required'] = $attribute->getIsRequired();
                 }
             }
         }
     }
 }