public function addFormFields(FormBuilderInterface $builder, FormInterface $form, $defaults)
    {
        $fieldset = $this->getFieldset($builder, $form);
        
        $fieldset->addChild($builder->getElement('tip', [
            'tip' => $this->trans('layout_box.product_status.tip'),
        ]));
        
        $statuses   = $this->get('product_status.dataset.admin')->getResult('select');
        $statusKeys = array_keys($statuses);
        
        $fieldset->addChild($builder->getElement('select', [
            'name'        => 'status',
            'label'       => $this->trans('product.label.statuses'),
            'options'     => $this->get('product_status.dataset.admin')->getResult('select'),
            'transformer' => $builder->getRepositoryTransformer('collection', $this->get('product_status.repository')),
        ]))->setValue(current($statusKeys));
    }
public function addFormFields(FormBuilderInterface $builder, FormInterface $form, $defaults)
    {
        $fieldset = $this->getFieldset($builder, $form);
        
        $fieldset->addChild($builder->getElement('tip', [
            'tip' => $this->trans('layout_box.product_status.tip'),
        ]));
        
        $statuses   = $this->get('product_status.dataset.admin')->getResult('select');
        $statusKeys = array_keys($statuses);
        
        $fieldset->addChild($builder->getElement('select', [
            'name'        => 'status',
            'label'       => $this->trans('product.label.statuses'),
            'options'     => $this->get('product_status.dataset.admin')->getResult('select'),
            'transformer' => $builder->getRepositoryTransformer('collection', $this->get('product_status.repository')),
        ]))->setValue(current($statusKeys));
    }
{@inheritdoc}