Ejemplo n.º 1
0
 /**
  * @param Form $form
  */
 private function logInvalidSubscription($form)
 {
     $error = 'Could not synchronize user ' . $form->getField('EMAIL')->getValue() . ":\n";
     /** @var Field $field */
     foreach ($form->getFields(TRUE) as $field) {
         foreach ($field->getErrors() as $error) {
             $error .= $field->getName() . ': ' . $this->translate($error) . "\n";
         }
     }
     GeneralUtility::sysLog($error, 't3chimp', 2);
 }
Ejemplo n.º 2
0
 /**
  * @param Form $form
  * @return array returns field values at index 0 and interest groupings at index 1
  */
 public function separateForm(Form $form)
 {
     $fieldValues = array();
     $selectedGroupings = array();
     $emailFormat = 'HTML';
     /** @var Field\AbstractField $field */
     foreach ($form->getFields(TRUE) as $field) {
         if ($field->getIsActionField()) {
             continue;
         } elseif ($field->getIsInterestGroup()) {
             $selectedGroupings[] = array('id' => $field->getGroupingId(), 'groups' => $field->getApiValue());
         } else {
             if ($field->getIsEmailFormatField()) {
                 $emailFormat = $field->getApiValue();
             } else {
                 $fieldValues[] = array('tag' => $field->getTag(), 'value' => $field->getApiValue());
             }
         }
     }
     return array($fieldValues, $selectedGroupings, $emailFormat);
 }