コード例 #1
0
 /**
  * @param AbstractAttribute $attribute
  * @param array             $data
  */
 protected function addLabels(AbstractAttribute $attribute, $data)
 {
     foreach ($data as $key => $label) {
         if (strpos($key, 'label-') !== false) {
             $locale = str_replace('label-', '', $key);
             $translation = $attribute->getTranslation($locale);
             $translation->setLabel($label);
         }
     }
 }
コード例 #2
0
 /**
  * @param AbstractAttribute $attribute
  * @param array             $data
  */
 protected function addLabels(AbstractAttribute $attribute, $data)
 {
     foreach ($data['label'] as $locale => $label) {
         $translation = $attribute->getTranslation($locale);
         $translation->setLabel($label);
     }
 }