Completed
Push — master ( 8974a5...43dd1c )
by Adam
06:18
created

OrderNoteFormBuilder::buildForm()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 13

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 9.3142
c 0
b 0
f 0
cc 1
eloc 13
nc 1
nop 1
1
<?php
2
/*
3
 * WellCommerce Open-Source E-Commerce Platform
4
 *
5
 * This file is part of the WellCommerce package.
6
 *
7
 * (c) Adam Piotrowski <[email protected]>
8
 *
9
 * For the full copyright and license information,
10
 * please view the LICENSE file that was distributed with this source code.
11
 */
12
13
namespace WellCommerce\Bundle\OrderBundle\Form\Admin;
14
15
use WellCommerce\Bundle\CoreBundle\Form\AbstractFormBuilder;
16
use WellCommerce\Component\Form\Elements\FormInterface;
17
18
/**
19
 * Class OrderNoteFormBuilder
20
 *
21
 * @author  Adam Piotrowski <[email protected]>
22
 */
23
class OrderNoteFormBuilder extends AbstractFormBuilder
24
{
25
    public function getAlias(): string
26
    {
27
        return 'admin.order_note';
28
    }
29
    
30
    public function buildForm(FormInterface $form)
31
    {
32
        $requiredData = $form->addChild($this->getElement('nested_fieldset', [
33
            'name'  => 'status_data',
34
            'label' => 'common.fieldset.general',
35
        ]));
36
        
37
        $requiredData->addChild($this->getElement('text_area', [
38
            'name'  => 'content',
39
            'rows'  => 10,
40
            'label' => 'order_note.label.content',
41
        ]));
42
        
43
        $form->addChild($this->getElement('submit', [
44
            'name'  => 'add_order_note',
45
            'label' => 'order_note.button.save',
46
        ]));
47
        
48
        $form->addFilter($this->getFilter('trim'));
49
        $form->addFilter($this->getFilter('secure'));
50
    }
51
}
52