Completed
Push — master ( 395774...b3be9a )
by
unknown
16s queued 12s
created

DealerMetaSEOForm::buildForm()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 39

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 39
rs 9.296
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
namespace Dealer\Form;
4
5
use Dealer\Dealer;
6
use Symfony\Component\Form\Extension\Core\Type\TextareaType;
7
use Symfony\Component\Validator\Constraints\NotBlank;
8
use Thelia\Form\BaseForm;
9
10
class DealerMetaSEOForm extends BaseForm
11
{
12
    protected function buildForm()
13
    {
14
        $this->formBuilder
15
            ->add("dealer_id", "hidden", array(
16
                "required" => true,
17
                "constraints" => array(new NotBlank(), ),
18
                "attr" => array()
19
            ))
20
            ->add("meta_title", "text", array(
21
                "label" => $this->translator->trans("Title SEO", [], Dealer::MESSAGE_DOMAIN),
22
                "label_attr" => ["for" => "meta_title"],
23
                "required" => false,
24
                "attr" => array()
25
            ))
26
            ->add("meta_description", "text", array(
27
                "label" => $this->translator->trans("Description SEO", [], Dealer::MESSAGE_DOMAIN),
28
                "label_attr" => ["for" => "dealer.description"],
29
                "required" => false,
30
                "attr" => array()
31
            ))
32
            ->add("meta_keywords", "text", array(
33
                "label" => $this->translator->trans("Keywords SEO", [], Dealer::MESSAGE_DOMAIN),
34
                "label_attr" => ["for" => "meta_keywords"],
35
                "required" => false,
36
                "attr" => array()
37
            ))
38
            ->add("slug", "text", array(
39
                "label" => $this->translator->trans("Slug SEO", [], Dealer::MESSAGE_DOMAIN),
40
                "required" => false,
41
                "attr" => array(),
42
                "label_attr" => array("for" => "slug"),
43
            ))
44
            ->add("meta_json", TextareaType::class, array(
45
                "label" => $this->translator->trans("Meta json", [], Dealer::MESSAGE_DOMAIN),
46
                "required" => false,
47
                "attr" => array(),
48
                "label_attr" => array("for" => "meta_json"),
49
            ));
50
    }
51
    public function getName()
52
    {
53
        return "dealer_meta_seo";
54
    }
55
}
56