Proyectos de Subversion LeadersLinked - Backend

Rev

Rev 15451 | Rev 16325 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 15451 Rev 15831
Línea 16... Línea 16...
16
class MyCoachCategoryForm extends Form
16
class MyCoachCategoryForm extends Form
17
{
17
{
Línea 18... Línea 18...
18
 
18
 
19
    /**
19
    /**
20
     * 
-
 
21
     * @param AdapterInterface $adapter
-
 
22
     * @param int $company_id
20
     * 
23
     * @param int $allowPrivacyPublic
21
     * @param int $allowPrivacyPublic
24
     */
22
     */
25
    public function __construct($adapter, $company_id, $allowPrivacyPublic) {
23
    public function __construct($allowPrivacyPublic) {
26
        parent::__construct();
24
        parent::__construct();
Línea 27... Línea 25...
27
        $this->setInputFilter(new MyCoachCategoryFilter($adapter));
25
        $this->setInputFilter(new MyCoachCategoryFilter());
28
 
26
 
29
         $this->add([
27
         $this->add([
30
            'name' => 'name',
28
            'name' => 'name',
Línea 79... Línea 77...
79
                //'disable_inarray_validator' => true,
77
                //'disable_inarray_validator' => true,
80
                'value_options' =>  $options
78
                'value_options' =>  $options
81
            ]
79
            ]
82
        ]);
80
        ]);
Línea 83... Línea -...
83
        
-
 
84
        $this->add([
-
 
85
            'name' => 'editors',
-
 
86
            'type' => \Laminas\Form\Element\Select::class,
-
 
87
            'attributes' => [
-
 
88
                'multiple' => true,
-
 
89
                'id' =>  'editors',
-
 
90
            ],
-
 
91
            'options' => [
-
 
92
                'disable_inarray_validator' => true,
-
 
93
                'value_options' =>  $this->editorOptions($adapter, $company_id),
-
 
94
            ]
-
 
95
        ]);
-
 
96
        
-
 
97
    }
81
        
98
    
-
 
99
    private function editorOptions($adapter, $company_id)
-
 
100
    {
-
 
101
        $options = [];
-
 
102
        $userMapper = UserMapper::getInstance($adapter);
-
 
103
        $records = $userMapper->fetchAllByCompanyId($company_id);
-
 
104
        
-
 
105
        foreach($records as $record)
-
 
106
        {
-
 
107
            $options[ $record->uuid ] = trim($record->first_name . ' ' . $record->last_name .  '(' . $record->email . ')');
-
 
108
        }
-
 
109
        
-
 
Línea 110... Línea 82...
110
        return $options;
82
 
Línea -... Línea 83...
-
 
83
        
111
        
84
    }