Proyectos de Subversion LeadersLinked - Backend

Rev

| Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
16817 efrain 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace LeadersLinked\Form\Survey;
6
 
7
use Laminas\Form\Form;
8
use Laminas\Db\Adapter\AdapterInterface;
9
use Laminas\Log\LoggerInterface;
10
use LeadersLinked\Mapper\CompanySizeMapper;
11
use LeadersLinked\Mapper\SurveyFormMapper;
12
use LeadersLinked\Model\SurveyForm;
13
 
14
class SurveyFormForm extends Form
15
{
16
 
17
    /**
18
     *
19
     * @param AdapterInterface $adapter
20
     * @param int $company_id
21
     */
22
    public function __construct($adapter, $company_id)
23
    {
24
        parent::__construct();
25
        $this->setInputFilter(new SurveyFormFilter($adapter));
26
 
27
        $this->add([
28
            'name' => 'name',
29
            'type' => \Laminas\Form\Element\Text::class,
30
             'attributes' => [
31
                'maxlength' 	=> 128,
32
                'id' 			=> 'name',
33
            ]
34
        ]);
35
 
36
        $this->add([
37
            'name' => 'text',
38
            'type' => \Laminas\Form\Element\Textarea::class,
39
             'attributes' => [
40
                'id' 			=> 'text',
41
                 'maxlength' 	=> 1024,
42
             ],
43
        ]);
44
 
45
 
46
        $this->add([
47
            'name' => 'status',
48
            'type' => \Laminas\Form\Element\Checkbox::class,
49
            'attributes' => [
50
                'id' 			=> 'status',
51
            ],
52
            'options' => [
53
                'use_hidden_element' => false,
54
                'unchecked_value' => SurveyForm::STATUS_INACTIVE,
55
                'checked_value'=> SurveyForm::STATUS_ACTIVE,
56
            ]
57
        ]);
58
 
59
 
60
        $this->add([
61
            'name' => 'content',
62
            'type' => \Laminas\Form\Element\Textarea::class,
63
            'attributes' => [
64
                'id'    => 'content',
65
            ]
66
        ]);
67
 
68
    }
69
 
70
 
71
}