本文整理汇总了PHP中Enlight_Event_EventArgs::setProcessed方法的典型用法代码示例。如果您正苦于以下问题:PHP Enlight_Event_EventArgs::setProcessed方法的具体用法?PHP Enlight_Event_EventArgs::setProcessed怎么用?PHP Enlight_Event_EventArgs::setProcessed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Enlight_Event_EventArgs
的用法示例。
在下文中一共展示了Enlight_Event_EventArgs::setProcessed方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onNotifyConfirmAction
/**
* If confirmation link in email was clicked
* Make entry in s_articles_notification table
* @static
* @param Enlight_Event_EventArgs $args
* @return
*/
public static function onNotifyConfirmAction(Enlight_Event_EventArgs $args)
{
$args->setProcessed(true);
$action = $args->getSubject();
$action->View()->NotifyValid = false;
$action->View()->NotifyInvalid = false;
if (!empty($action->Request()->sNotificationConfirmation) && !empty($action->Request()->sNotify)) {
$getConfirmation = Shopware()->Db()->fetchRow('
SELECT * FROM s_core_optin WHERE hash = ?
', array($action->Request()->sNotificationConfirmation));
$notificationConfirmed = false;
if (!empty($getConfirmation['hash'])) {
$notificationConfirmed = true;
$json_data = unserialize($getConfirmation['data']);
Shopware()->Db()->query('DELETE FROM s_core_optin WHERE hash=?', array($action->Request()->sNotificationConfirmation));
}
if ($notificationConfirmed) {
$sql = '
INSERT INTO `s_articles_notification` (
`ordernumber` ,
`date` ,
`mail` ,
`language` ,
`shopLink` ,
`send`
)
VALUES (
?, NOW(), ?, ?, ?, 0
);
';
Shopware()->Db()->query($sql, array($json_data['notifyOrdernumber'], $json_data['sNotificationEmail'], $json_data['sLanguage'], $json_data['sShopPath']));
$action->View()->NotifyValid = true;
Shopware()->Session()->sNotifcationArticleWaitingForOptInApprovement[$json_data['notifyOrdernumber']] = false;
} else {
$action->View()->NotifyInvalid = true;
}
}
return $action->forward('index');
}
示例2: collect
/**
* Event which is fired to collect plugin parameters
* to register additionally application components or configurations.
*
* @param $event
* @param ArrayCollection $collection
* @param null $eventArgs
*
* @throws Enlight_Event_Exception
* @return ArrayCollection|null
*/
public function collect($event, ArrayCollection $collection, $eventArgs = null)
{
if (!$this->hasListeners($event)) {
return $collection;
}
if (isset($eventArgs) && is_array($eventArgs)) {
$eventArgs = new Enlight_Event_EventArgs($eventArgs);
} elseif (!isset($eventArgs)) {
$eventArgs = new Enlight_Event_EventArgs();
} elseif (!$eventArgs instanceof Enlight_Event_EventArgs) {
throw new Enlight_Event_Exception('Parameter "eventArgs" must be an instance of "Enlight_Event_EventArgs"');
}
$eventArgs->setName($event);
$eventArgs->setProcessed(false);
foreach ($this->getListeners($event) as $listener) {
$listenerCollection = $listener->execute($eventArgs);
if ($listenerCollection instanceof ArrayCollection) {
foreach ($listenerCollection->getValues() as $value) {
$collection->add($value);
}
} elseif ($listenerCollection !== null) {
$collection->add($listenerCollection);
}
}
$eventArgs->setProcessed(true);
return $collection;
}
示例3: filter
/**
* Checks if the event has registered listeners.
* If the event has listeners this listeners will be executed with the given event arguments.
* The event arguments have to been an array or an instance of the Enlight_Event_EventArgs class.
* If the given arguments not an array or an instance of the Enlight_Event_EventArgs class enlight
* throw an Enlight_Event_Exception.
* Before the listener will be executed the the flag "processed" will be set to false in the event arguments.
* After all event listeners has been executed the "processed" flag will be set to true.
*
* The return value of the execute method will be set in the event arguments return value.
*
* @throws Enlight_Event_Exception
* @param string $event
* @param mixed $value
* @param Enlight_Event_EventArgs|array|null $eventArgs
* @return mixed
*/
public function filter($event, $value, $eventArgs = null)
{
if (!$this->hasListeners($event)) {
return $value;
}
if (isset($eventArgs) && is_array($eventArgs)) {
$eventArgs = new Enlight_Event_EventArgs($eventArgs);
} elseif (!isset($eventArgs)) {
$eventArgs = new Enlight_Event_EventArgs();
} elseif (!$eventArgs instanceof Enlight_Event_EventArgs) {
throw new Enlight_Event_Exception('Parameter "eventArgs" must be an instance of "Enlight_Event_EventArgs"');
}
$eventArgs->setReturn($value);
$eventArgs->setName($event);
$eventArgs->setProcessed(false);
foreach ($this->getListeners($event) as $listener) {
if (null !== ($return = $listener->execute($eventArgs))) {
$eventArgs->setReturn($return);
}
}
$eventArgs->setProcessed(true);
return $eventArgs->getReturn();
}