Rev 15831 | Ir a la última revisión | Autoría | Comparar con el anterior | Ultima modificación | Ver Log |
<?phpdeclare(strict_types=1);namespace LeadersLinked\Form\MyCoach;use Laminas\Form\Form;use Laminas\Db\Adapter\AdapterInterface;use Laminas\Log\LoggerInterface;use LeadersLinked\Model\Topic;use Laminas\Form\Element;use LeadersLinked\Mapper\UserMapper;class MyCoachCategoryForm extends Form{/**** @param int $allowPrivacyPublic*/public function __construct($allowPrivacyPublic) {parent::__construct();$this->setInputFilter(new MyCoachCategoryFilter());$this->add(['name' => 'name','type' => \Laminas\Form\Element\Text::class,'attributes' => ['maxlength' => 128,'id' => 'name',]]);$this->add(['name' => 'description','type' => \Laminas\Form\Element\Textarea::class,'attributes' => ['id' => 'description',]]);$this->add(['name' => 'status','type' => \Laminas\Form\Element\Checkbox::class,'attributes' => ['id' => 'status',],'options' => ['use_hidden_element' => 0,'unchecked_value' => \LeadersLinked\Model\MyCoachCategory::STATUS_INACTIVE,'checked_value'=> \LeadersLinked\Model\MyCoachCategory::STATUS_ACTIVE]]);$options = [];if($allowPrivacyPublic) {$options = [\LeadersLinked\Model\MyCoachCategory::PRIVACY_PUBLIC => 'LABEL_PUBLIC',\LeadersLinked\Model\MyCoachCategory::PRIVACY_COMPANY => 'LABEL_COMPANY',];} else {$options = [\LeadersLinked\Model\MyCoachCategory::PRIVACY_COMPANY => 'LABEL_COMPANY',];}$this->add(['name' => 'privacy','type' => \Laminas\Form\Element\Select::class,'attributes' => ['id' => 'privacy',],'options' => [//'disable_inarray_validator' => true,'value_options' => $options]]);}}