/**
  * {@inheritdoc}
  */
 public function buildValuesForm(FormInterface $form, FamilyInterface $family, DataInterface $data = null, array $options = [])
 {
     foreach ($family->getAttributes() as $attribute) {
         if ($attribute->getGroup()) {
             $groupName = $attribute->getGroup();
             if (!$form->has($groupName)) {
                 $form->add($groupName, 'form', ['inherit_data' => true]);
             }
             $this->addAttribute($form->get($groupName), $attribute, $family, $data, $options);
         } else {
             $this->addAttribute($form, $attribute, $family, $data, $options);
         }
     }
 }
 /**
  * @param FormInterface   $form
  * @param FamilyInterface $family
  * @param DataInterface   $data
  * @param array           $options
  *
  * @throws \Exception
  */
 public function buildValuesForm(FormInterface $form, FamilyInterface $family, DataInterface $data = null, array $options = [])
 {
     foreach ($family->getAttributes() as $attribute) {
         $this->addAttribute($form, $attribute, $family, $data, $options);
     }
 }
예제 #3
0
 /**
  * @param FamilyInterface $parent
  */
 protected function copyFromFamily(FamilyInterface $parent)
 {
     foreach ($parent->getAttributes() as $attribute) {
         $this->addAttribute($attribute);
     }
     $this->attributeAsLabel = $parent->getAttributeAsLabel();
     $this->attributeAsIdentifier = $parent->getAttributeAsIdentifier();
     $this->valueClass = $parent->getValueClass();
     $this->dataClass = $parent->getDataClass();
 }