Form/EventListener/CharacteristicsResizeListener.php
private function appendProperForm(FormInterface $form, Definition $definition)
    {
        $identifier = $definition->getIdentifier();
        if ($form->has($identifier)) {
            return;
        }

        $type = sprintf('ekyna_%s_characteristic', $definition->getType());
        $options = array();
        if ($definition->getType() == 'choice') {
            $options['identifier'] = $identifier;
        }

        $parentData = null;
        if (null !== $this->parentDatas && null !== $characteristic = $this->parentDatas->findCharacteristicByIdentifier($identifier)) {
            $parentData = $characteristic->display($definition);
        }

        $form->add($identifier, $type, array_merge(array(
            'property_path' => '[' . $identifier . ']',
            'label' => $definition->getTitle(),
            'parent_data' => $parentData,
        ), $options));
    }
private function appendProperForm(FormInterface $form, Definition $definition)
    {
        $identifier = $definition->getIdentifier();
        if ($form->has($identifier)) {
            return;
        }

        $type = sprintf('ekyna_%s_characteristic', $definition->getType());
        $options = array();
        if ($definition->getType() == 'choice') {
            $options['identifier'] = $identifier;
        }

        $parentData = null;
        if (null !== $this->parentDatas && null !== $characteristic = $this->parentDatas->findCharacteristicByIdentifier($identifier)) {
            $parentData = $characteristic->display($definition);
        }

        $form->add($identifier, $type, array_merge(array(
            'property_path' => '[' . $identifier . ']',
            'label' => $definition->getTitle(),
            'parent_data' => $parentData,
        ), $options));
    }
private function appendProperForm ( FormInterface $ form , Definition $ definition ) { $ identifier = $ definition -> getIdentifier ( ) ; if ( $ form -> has ( $ identifier ) ) { return ; } $ type = sprintf ( 'ekyna_%s_characteristic' , $ definition -> getType ( ) ) ; $ options = array ( ) ; if ( $ definition -> getType ( ) == 'choice' ) { $ options [ 'identifier' ] = $ identifier ; } $ parentData = null ; if ( null !== $ this -> parentDatas && null !== $ characteristic = $ this -> parentDatas -> findCharacteristicByIdentifier ( $ identifier ) ) { $ parentData = $ characteristic -> display ( $ definition ) ; } $ form -> add ( $ identifier , $ type , array_merge ( array ( 'property_path' => '[' . $ identifier . ']' , 'label' => $ definition -> getTitle ( ) , 'parent_data' => $ parentData , ) , $ options ) ) ; }
Appends a form that matches the characteristic type.

@param \Symfony\Component\Form\FormInterface $form
@param \Ekyna\Component\Characteristics\Schema\Definition $definition
Appends a form that matches the characteristic type .