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

OrderNoteFormBuilder::getAlias()   A

↳ Parent: OrderNoteFormBuilder

Complexity

Conditions 1
Paths 1

Duplication

Lines 0
Ratio 0 %

Size

Total Lines 4
Code Lines 2

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
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