AutorÃa | Ultima modificación | Ver Log |
<?phpdeclare(strict_types=1);namespace LeadersLinked\Form\DiscoveryContact;use Laminas\Form\Form;use Laminas\Db\Adapter\Adapter;use LeadersLinked\Mapper\DiscoveryContactBlackListReasonMapper;class BlackListEditForm extends Form{/**** @param Adapter $adapter* @param int $company_id*/public function __construct($adapter, $company_id){parent::__construct();$this->setInputFilter(new BlackListEditFilter($adapter, $company_id));$this->add(['name' => 'first_name','type' => \Laminas\Form\Element\Text::class,'attributes' => ['maxlength' => 128,'id' => 'first_name','readonly' => 'readonly']]);$this->add(['name' => 'last_name','type' => \Laminas\Form\Element\Text::class,'attributes' => ['maxlength' => 128,'id' => 'last_name','readonly' => 'readonly']]);$this->add(['name' => 'email','type' => \Laminas\Form\Element\Text::class,'attributes' => ['maxlength' => 250,'id' => 'email','readonly' => 'readonly']]);$this->add(['name' => 'notes','type' => \Laminas\Form\Element\Textarea::class,'attributes' => ['id' => 'notes',]]);$this->add(['name' => 'blacklist_reason_id','type' => \Laminas\Form\Element\Select::class,'options' => ['empty_option' => 'LABEL_SELECT','value_options' => $this->optionsReasons($adapter, $company_id),],'attributes' => ['id' => 'blacklist_reason_id',]]);}private function optionsReasons($adapter, $company_id){$items = [];$discoveryContactBlackListReasonMapper = DiscoveryContactBlackListReasonMapper::getInstance($adapter);$records = $discoveryContactBlackListReasonMapper->fetchAllActiveByCompanyId($company_id);foreach($records as $record){$items[ $record->uuid ] = $record->name;}return $items;}}