/**
  * Returns the editfield dynaflex config for all attributes of a product.
  *
  * @param array $funcDataArray Function data
  * @param array $baseConfig Base config
  *
  * @return array An array with fieldconfigs
  */
 public function getAttributeEditFields(array $funcDataArray, array $baseConfig)
 {
     $result = array();
     $sortedAttributes = array();
     foreach ($funcDataArray as $funcData) {
         if ($funcData['row']['uid_foreign'] == 0) {
             continue;
         }
         $aData = $this->belib->getAttributeData($funcData['row']['uid_foreign'], 'uid, title, has_valuelist, multiple, unit, deleted');
         // get correlationtype for this attribute and the product of this article
         // first get the product for this aticle
         $productUid = $this->belib->getProductOfArticle($funcData['row']['uid_local'], false);
         $uidCorrelationType = $this->belib->getCtForAttributeOfProduct($funcData['row']['uid_foreign'], $productUid);
         $sortedAttributes[$uidCorrelationType][] = $aData;
     }
     ksort($sortedAttributes);
     reset($sortedAttributes);
     foreach ($sortedAttributes as $ctUid => $attributes) {
         // add a userfunction as header
         foreach ($attributes as $attribute) {
             $onlyDisplay = $ctUid == 1 && $attribute['has_valuelist'] || $ctUid == 4;
             $fieldConfig = $this->getAttributeEditField($attribute, $baseConfig, false, $onlyDisplay);
             if (is_array($fieldConfig) && !empty($fieldConfig)) {
                 $result[] = $fieldConfig;
             }
         }
     }
     return $result;
 }