Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev 17002 Rev 17080
Línea 13... Línea 13...
13
use LeadersLinked\Mapper\UserMapper;
13
use LeadersLinked\Mapper\UserMapper;
Línea 14... Línea 14...
14
 
14
 
15
class TopicForm extends Form
15
class TopicForm extends Form
Línea 16... Línea 16...
16
{
16
{
17
 
17
 
18
    public function __construct(){
18
    public function __construct($adapter, $company_id){
Línea -... Línea 19...
-
 
19
        parent::__construct();
-
 
20
        $this->setInputFilter(new TopicFilter());
-
 
21
 
-
 
22
        
-
 
23
        $this->add([
-
 
24
            'name' => 'capsules_id',
-
 
25
            'type' => \Laminas\Form\Element\Select::class,
-
 
26
            'attributes' => [
-
 
27
                'id' => 'capsules_id',
-
 
28
                'multiple' => true,
-
 
29
            ],
-
 
30
            'options' => [
Línea 19... Línea 31...
19
        parent::__construct();
31
                'value_options' => $this->getSelectOptions($adapter, $company_id)
20
        $this->setInputFilter(new TopicFilter());
32
            ]
21
 
33
        ]);
Línea 51... Línea 63...
51
                'checked_value'=> \LeadersLinked\Model\Topic::STATUS_ACTIVE,
63
                'checked_value'=> \LeadersLinked\Model\Topic::STATUS_ACTIVE,
52
            ]
64
            ]
53
        ]);
65
        ]);
54
    }
66
    }
Línea -... Línea 67...
-
 
67
 
-
 
68
    private function getSelectOptions($adapter, $company_id)
-
 
69
    {
-
 
70
        $options = [];
-
 
71
        
-
 
72
        $mapper = MicrolearningCapsuleMapper::getInstance($adapter);
-
 
73
        $records = $mapper->fetchAllActiveByCompanyId($company_id); 
-
 
74
 
-
 
75
        foreach($records as $record)
-
 
76
        {
-
 
77
            $options[$record->uuid] = $record->name;    
-
 
78
        }
-
 
79
        return $options;
-
 
80
    }
55
 
81