_getDataObj()->setFilter('tribeId', $tribeId); } return parent::exec(); } protected function _addListItem() { Qs_View::getInstance()->addHelperPath('App/License/View/Helper/', 'App\License\View\Helper\\'); parent::_addListItem(); return $this; } protected function _getFormOptions($type = null) { $options = parent::_getFormOptions($type); if (in_array($type, ['new', 'edit'])) { $options['vendorAutocompleteUrl'] = VendorAutocompleteAdminView::getPage('url'); } return $options; } protected function _getFormInstance($type, array $options = []) { $form = parent::_getFormInstance($type, $options); /** @var Qs_Form_Element_MultiDataAutocomplete $vendorsAutocomplete */ if (($form instanceof EditForm && ($vendorsAutocomplete = $form->getElement('vendors')) && ($vendorIds = $this->_getDataObj()->getData('vendors'))) ) { $vendorsAutocomplete->setTitles(VendorAutocompleteAdminObj::getAutocompleteItemTitles($vendorIds)); } /** @var Qs_Form_Element_Autocomplete $vendorAutocomplete */ if (($form instanceof FilterForm && ($vendorAutocomplete = $form->getElement('vendorId')) && ($vendorId= Qs_Request::getRequestValue('vendorId'))) ) { $vendorAutocomplete->setTitle(VendorAutocompleteAdminObj::getAutocompleteItemTitle($vendorId)); } return $form; } protected function _initFromForm(\Qs_Form $form) { $data = $form->getValues(); if ($data['vendors'] === null) { $data['vendors'] = []; } if ($data['naicsCodes'] === null) { $data['naicsCodes'] = []; } $this->_getDataObj()->initFromForm($data); return $this; } protected function _postInsert() { (new MailQueueObj())->createQueue($this->_getDataObj()->clearData()->getData()); Qs_Job::run(MailQueueView::getPage('url')); return parent::_postInsert(); } protected function _postUpdate() { $mailQueueObj = new MailQueueObj(); $data = $this->_getDataObj()->clearData()->getData(); $mailQueueObj->deleteMailingData($data['id']); $mailQueueObj->createQueue($data); Qs_Job::run(MailQueueView::getPage('url')); return parent::_postUpdate(); } }