MailchimpEcommerceSync.php in Mailchimp E-Commerce 8
File
src/Form/MailchimpEcommerceSync.php
View source
<?php
namespace Drupal\mailchimp_ecommerce\Form;
use Drupal\Core\Form\FormBase;
use Drupal\Core\Form\FormStateInterface;
abstract class MailchimpEcommerceSync extends FormBase {
public function getFormId() {
return 'mailchimp_ecommerce_sync';
}
public function buildForm(array $form, \Drupal\Core\Form\FormStateInterface $form_state) {
$form['sync_products'] = [
'#type' => 'checkbox',
'#title' => t('Sync Products'),
'#description' => t('Sync all existing products to Mailchimp.'),
];
$form['actions']['submit'] = [
'#type' => 'submit',
'#value' => $this
->t('Sync with Mailchimp'),
'#button_type' => 'primary',
];
return $form;
}
public function submitForm(array &$form, FormStateInterface $form_state) {
$this
->_submitForm($form, $form_state);
}
public abstract function _submitForm($form, $form_state);
}