Proyectos de Subversion LeadersLinked - Backend

Rev

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

Rev Autor Línea Nro. Línea
17002 efrain 1
<?php
2
 
3
declare(strict_types=1);
4
 
5
namespace LeadersLinked\Form\Microlearning;
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\IndustryMapper;
12
use LeadersLinked\Model\Feed;
13
use LeadersLinked\Model\MicrolearningTopic;
17110 stevensc 14
use Laminas\Form\Element\Select;
17002 efrain 15
 
16
class TopicAddForm extends Form
17
{
18
 
17110 stevensc 19
    public function __construct($adapter, $company_id)
17002 efrain 20
    {
21
        parent::__construct();
17110 stevensc 22
        $this->setInputFilter(new TopicAddFilter($adapter));
17002 efrain 23
 
24
 
25
        $this->add([
26
            'name' => 'name',
27
            'type' => \Laminas\Form\Element\Textarea::class,
28
            'attributes' => [
29
                'id'    => 'name',
30
            ]
31
        ]);
32
 
33
        $this->add([
34
            'name' => 'description',
35
            'type' => \Laminas\Form\Element\Textarea::class,
36
            'attributes' => [
37
                'id'    => 'description',
38
            ]
39
        ]);
40
 
41
        $this->add([
42
            'name' => 'order',
43
            'type' => \Laminas\Form\Element\Text::class,
44
            'attributes' => [
45
                'id'    => 'order',
46
            ],
47
        ]);
48
 
49
        $this->add([
50
            'name' => 'file',
51
            'type' => \Laminas\Form\Element\Hidden::class,
52
            'attributes' => [
53
                'id' => 'file',
54
            ]
17110 stevensc 55
        ]);
17002 efrain 56
 
57
        $this->add([
58
            'name' => 'status',
59
            'type' => \Laminas\Form\Element\Select::class,
60
            'options' => [
61
                'empty_option' => 'LABEL_STATUS',
62
                'value_options' => [
63
                    MicrolearningTopic::STATUS_ACTIVE => 'LABEL_ACTIVE',
64
                    MicrolearningTopic::STATUS_INACTIVE => 'LABEL_INACTIVE',
65
                ],
66
            ],
67
            'attributes' => [
68
                'id' => 'status',
69
            ]
70
        ]);
71
 
17110 stevensc 72
        $this->add([
73
            'name' => 'capsule_uuid',
74
            'type' => Select::class,
75
            'attributes' => [
76
                'multiple' 	=> 'yes',
77
                'id' =>  'capsule_uuid',
78
            ],
79
            'options' => [
80
                'disable_inarray_validator' => true,
81
                'value_options' => $this->getSelectOptions($adapter, $company_id)
82
            ]
83
        ]);
17002 efrain 84
    }
85
}