Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 1 | Rev 4398 | Ir a la última revisión | | Comparar con el anterior | Ultima modificación | Ver Log |

Rev Autor Línea Nro. Línea
1 www 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace LeadersLinked\Form\AccountSetting;
6
 
7
use Laminas\Form\Form;
8
use Laminas\Db\Adapter\AdapterInterface;
4113 efrain 9
use LeadersLinked\Library\Functions;
1 www 10
use LeadersLinked\Mapper\SkillMapper;
11
use LeadersLinked\Model\User;
12
 
13
class BasicForm extends Form
14
{
15
    public function __construct()
16
    {
17
        parent::__construct();
18
        $this->setInputFilter(new BasicFilter());
19
 
20
        $this->add([
21
            'name' => 'phone',
22
            'type' => \Laminas\Form\Element\Text::class,
23
            'attributes' => [
24
                'maxlength' 	=> 18,
25
                'id' 			=> 'phone',
26
            ]
27
        ]);
28
 
29
        $this->add([
30
            'name' => 'first_name',
31
            'type' => \Laminas\Form\Element\Hidden::class,
32
            'attributes' => [
33
                'id'    => 'first_name',
34
            ]
35
        ]);
36
 
37
        $this->add([
38
            'name' => 'last_name',
39
            'type' => \Laminas\Form\Element\Hidden::class,
40
            'attributes' => [
41
                'id'    => 'last_name',
42
            ]
43
        ]);
44
 
45
        $this->add([
46
            'name' => 'gender',
47
            'type' => \Laminas\Form\Element\Select::class,
48
            'options' => [
49
                'value_options' =>  [
50
                    User::GENDER_FEMALE => 'LABEL_FEMALE',
51
                    User::GENDER_MALE => 'LABEL_MALE'
52
                ],
53
            ],
54
            'attributes' => [
55
                'id' => 'gender',
56
            ]
57
        ]);
58
 
59
        $this->add([
60
            'name' => 'email',
61
            'type' => \Laminas\Form\Element\Text::class,
62
            'attributes' => [
63
                'maxlength' 	=> 250,
64
                'id' 			=> 'email',
65
            ]
66
        ]);
4113 efrain 67
 
68
        $this->add([
69
            'name' => 'timezone',
70
            'type' => \Laminas\Form\Element\Select::class,
71
            'options' => [
72
                'value_options' =>  $this->getTimeZones(),
73
            ],
74
            'attributes' => [
75
                'id' => 'timezone',
76
            ]
77
        ]);
1 www 78
    }
4113 efrain 79
 
80
    private function getTimeZones()
81
    {
82
        $options = [];
83
 
84
        $records = Functions::getAllTimeZones();
85
        foreach($records as $record)
86
        {
87
            $options[ $record ] = $record;
88
        }
89
 
90
        return $options;
91
 
92
    }
1 www 93
 
94
}