forked from koala-framework/koala-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Component.php
24 lines (21 loc) · 930 Bytes
/
Component.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<?php
class Kwc_Newsletter_Unsubscribe_Component extends Kwc_Abstract_Composite_Component
{
public static function getSettings()
{
$ret = parent::getSettings();
$ret['rootElementClass'] = 'kwfUp-webStandard';
$ret['generators']['child']['component']['form'] = 'Kwc_Newsletter_Unsubscribe_Form_Component';
$ret['placeholder']['headline'] = trlKwfStatic('Unsubscribe newsletter');
return $ret;
}
public function processMailRedirectInput($recipient, $params)
{
if (!($recipient instanceof Kwc_Mail_Recipient_UnsubscribableInterface)) {
throw new Kwf_Exception("To unsubscribe from a newsletter, the recipient row must implement 'Kwc_Mail_Recipient_UnsubscribableInterface'");
}
$comp = $this->getData()->getChildComponent('-form')->getComponent();
$comp->_recipient = $recipient;
$comp->processInput($params);
}
}