Proyectos de Subversion LeadersLinked - Services

Rev

Rev 307 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 307 Rev 308
Línea 20... Línea 20...
20
     * @param int $user_id
20
     * @param int $user_id
21
     */
21
     */
22
    public function __construct($adapter, $user_id) 
22
    public function __construct($adapter, $user_id) 
23
    {
23
    {
24
        parent::__construct();
24
        parent::__construct();
25
        $this->setInputFilter(new HabitGoalFilter($adapter));
25
        $this->setInputFilter(new HabitGoalFilter($adapter, $user_id));
Línea 26... Línea 26...
26
 
26
 
27
        $this->add([
27
        $this->add([
28
            'name' => 'name',
28
            'name' => 'name',
29
            'type' => \Laminas\Form\Element\Text::class,
29
            'type' => \Laminas\Form\Element\Text::class,
Línea 32... Línea 32...
32
                'maxlength' => 100
32
                'maxlength' => 100
33
            ]
33
            ]
34
        ]);
34
        ]);
Línea 35... Línea 35...
35
        
35
        
-
 
36
        $this->add([
-
 
37
            'name' => 'description',
-
 
38
            'type' => \Laminas\Form\Element\Textarea::class,
-
 
39
            'attributes' => [
-
 
40
                'id'    => 'description',
-
 
41
                'maxlength' => 512
-
 
42
            ]
-
 
43
        ]);
-
 
44
        
-
 
45
        $this->add([
-
 
46
            'name' => 'value',
-
 
47
            'type' => \Laminas\Form\Element\Text::class,
-
 
48
            'attributes' => [
-
 
49
                'id'    => 'value',
-
 
50
                'maxlength' => 5
-
 
51
            ]
-
 
52
        ]);
-
 
53
        
-
 
54
        $this->add([
-
 
55
            'name' => 'start_date',
-
 
56
            'type' => \Laminas\Form\Element\Text::class,
-
 
57
            'attributes' => [
-
 
58
                'id'    => 'start_date',
-
 
59
                'maxlength' => 20
-
 
60
            ]
-
 
61
        ]);
-
 
62
        
-
 
63
        $this->add([
-
 
64
            'name' => 'end_date',
-
 
65
            'type' => \Laminas\Form\Element\Text::class,
-
 
66
            'attributes' => [
-
 
67
                'id'    => 'end_date',
-
 
68
                'maxlength' => 20
-
 
69
            ]
-
 
70
        ]);
-
 
71
        
-
 
72
        
-
 
73
        
-
 
74
        
36
        $this->add([
75
        $this->add([
37
            'name' => 'skill_id',
76
            'name' => 'skill_id',
38
            'type' => \Laminas\Form\Element\Select::class,
77
            'type' => \Laminas\Form\Element\Select::class,
39
            'attributes' => [
78
            'attributes' => [
40
                'multiple' 	=> 'yes',
79
                'multiple' 	=> 'yes',
Línea 43... Línea 82...
43
            'options' => [
82
            'options' => [
44
                'disable_inarray_validator' => true,
83
                'disable_inarray_validator' => true,
45
                'value_options' => $this->getSelectOptions($adapter, $user_id)
84
                'value_options' => $this->getSelectOptions($adapter, $user_id)
46
            ]
85
            ]
47
        ]);
86
        ]);
48
        
-
 
49
        
-
 
Línea 50... Línea 87...
50
       
87
       
Línea 51... Línea 88...
51
    }
88
    }
52
    
89
    
Línea 58... Línea 95...
58
        $records = $habitSkillMapper->fetchAllByUserId($user_id);
95
        $records = $habitSkillMapper->fetchAllByUserId($user_id);
59
        foreach($records as $record)
96
        foreach($records as $record)
60
        {
97
        {
61
            $items[ $record->uuid ]  = $record->name;
98
            $items[ $record->uuid ]  = $record->name;
62
        }
99
        }
-
 
100
 
-
 
101
 
63
        return $items;
102
        return $items;
Línea 64... Línea 103...
64
        
103
        
65
    }
104
    }