当前位置: 首页>>代码示例>>PHP>>正文


PHP Event::getParams方法代码示例

本文整理汇总了PHP中Zend\EventManager\Event::getParams方法的典型用法代码示例。如果您正苦于以下问题:PHP Event::getParams方法的具体用法?PHP Event::getParams怎么用?PHP Event::getParams使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend\EventManager\Event的用法示例。


在下文中一共展示了Event::getParams方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: checkUserCredentials

 public function checkUserCredentials(Event $e)
 {
     if ($e->getParams()['username'] == 'test_event_true') {
         $e->stopPropagation();
         return true;
     }
     if ($e->getParams()['username'] == 'test_event_false') {
         $e->stopPropagation();
         return false;
     }
 }
开发者ID:api-skeletons,项目名称:zf-oauth2-doctrine,代码行数:11,代码来源:TestEvents.php

示例2: queueMail

 /**
  * @param Event $e
  * @throws ServiceException
  */
 public function queueMail(Event $e)
 {
     /* @var ServiceManager $sl */
     $sl = $e->getTarget()->getServiceLocator();
     $data = $e->getParams();
     /* @var $mailQueue MailQueue */
     $mailQueue = $sl->get('UthandoMailQueue');
     $hydrator = $mailQueue->getHydrator();
     $model = $mailQueue->getModel();
     $model = $hydrator->hydrate($data, $model);
     $mailQueue->save($model);
 }
开发者ID:uthando-cms,项目名称:uthando-mail,代码行数:16,代码来源:MailListener.php

示例3: __invoke

 /**
  * Allow calls as this would be a function.
  *
  * @param Event $event
  */
 public function __invoke(Event $event)
 {
     try {
         $connection = $this->factory->createConnection();
         $channel = $connection->channel();
         $channel->queue_declare('notify_queue', false, true, false, false);
         $msg = new AMQPMessage(json_encode($event->getParams()), ['delivery_mode' => 2]);
         $channel->basic_publish($msg, '', 'notify_queue');
         $channel->close();
         $connection->close();
     } catch (\Exception $e) {
         $this->logger->critical("Notify Service Event says: {$e->getMessage()}", $e->getTrace());
     }
 }
开发者ID:bix0r,项目名称:Stjornvisi,代码行数:19,代码来源:NotifyListener.php

示例4: onSendEmail

 public function onSendEmail(Event $e)
 {
     /** @var QueueInterface $queue */
     $queue = $this->queues->get('user');
     $emailJob = $queue->getJobPluginManager()->get(SendEmailJob::class);
     $email = $e->getParams();
     $html = $this->renderer->render($email->getHtmlTemplate(), $email->getVars());
     $text = $this->renderer->render($email->getTextTemplate(), $email->getVars());
     $message = new MessageStruct();
     $message->html = $html;
     $message->text = $text;
     $message->to = $email->getTo();
     $emailJob->setContent($message);
     $queue->push($emailJob);
 }
开发者ID:eoko,项目名称:zf-mandrill,代码行数:15,代码来源:SendEmailListener.php

示例5: accept

 /**
  * Determines whether a page should be accepted by ACL when iterating
  *
  * - If helper has no ACL, page is accepted
  * - If page has a resource or privilege defined, page is accepted if the
  *   ACL allows access to it using the helper's role
  * - If page has no resource or privilege, page is accepted
  * - If helper has ACL and role:
  *      - Page is accepted if it has no resource or privilege.
  *      - Page is accepted if ACL allows page's resource or privilege.
  *
  * @param  Event    $event
  * @return bool
  */
 public static function accept(Event $event)
 {
     $accepted = true;
     $params = $event->getParams();
     $acl = $params['acl'];
     $page = $params['page'];
     $role = $params['role'];
     if (!$acl) {
         return $accepted;
     }
     $resource = $page->getResource();
     $privilege = $page->getPrivilege();
     if ($resource || $privilege) {
         $accepted = $acl->hasResource($resource) && $acl->isAllowed($role, $resource, $privilege);
     }
     return $accepted;
 }
开发者ID:eltondias,项目名称:Relogio,代码行数:31,代码来源:AclListener.php

示例6: getParams

 /**
  * Get all event parameters
  *
  * @return array|\ArrayAccess
  */
 public function getParams()
 {
     $params = parent::getParams();
     $params['model'] = $this->getModel();
     $params['renderer'] = $this->getRenderer();
     $params['request'] = $this->getRequest();
     $params['response'] = $this->getResponse();
     $params['result'] = $this->getResult();
     return $params;
 }
开发者ID:CHRISTOPHERVANDOMME,项目名称:zf2complet,代码行数:15,代码来源:ViewEvent.php

示例7: setEvent

 /**
  * Set an event to use during dispatch
  *
  * By default, will re-cast to AdapterChainEvent if another event type is provided.
  *
  * @param  Event $e
  * @return AdapterChain
  */
 public function setEvent(Event $e)
 {
     if (!$e instanceof AdapterChainEvent) {
         $eventParams = $e->getParams();
         $e = new AdapterChainEvent();
         $e->setParams($eventParams);
     }
     $this->event = $e;
     return $this;
 }
开发者ID:projectsmahendra,项目名称:blogger,代码行数:18,代码来源:AdapterChain.php

示例8: onAddItem

 public function onAddItem(Event $e)
 {
     $this->addItemToCart($e->getCartItem());
     $this->getEventManager()->trigger(CartEvent::EVENT_ADD_ITEM_POST, $this, $e->getParams());
 }
开发者ID:nclundsten,项目名称:SpeckCart,代码行数:5,代码来源:CartService.php

示例9: translationListener

 public function translationListener(Event $e)
 {
     $m = $e->getParams();
     error_log(sprintf("missingTranslation;%s;%s;", $m['message'], $m['locale']));
 }
开发者ID:ifigenija,项目名称:server,代码行数:5,代码来源:Module.php

示例10: setEvent

 /**
  * Set an event to use during the queue event flow
  *
  * By default, will re-cast to QueueEvent if another event type is provided.
  *
  * @param  Event $e
  * @return Queue
  */
 public function setEvent(Event $e)
 {
     if (!$e instanceof QueueEvent) {
         $eventParams = $e->getParams();
         $e = new QueueEvent();
         $e->setParams($eventParams);
         unset($eventParams);
     }
     $this->event = $e;
     return $this;
 }
开发者ID:stakhanovist,项目名称:queue,代码行数:19,代码来源:Queue.php

示例11: getParams

 /**
  * {@inheritdoc}
  */
 public function getParams()
 {
     $params = parent::getParams();
     $isObject = is_object($params);
     foreach ($this->specializedParams as $param) {
         if ($isObject) {
             $params->{$param} = $this->{'get' . $param}();
         } else {
             $params[$param] = $this->{'get' . $param}();
         }
     }
     return $params;
 }
开发者ID:matryoshka-model,项目名称:matryoshka,代码行数:16,代码来源:ModelEvent.php

示例12: navigationPageIsAllowed

 /**
  * Determine whether a navigation page is allowed.
  *
  * @param Event $event
  * @return bool
  */
 public function navigationPageIsAllowed(Event $event)
 {
     $accepted = true;
     $params = $event->getParams();
     $acl = $params['acl'];
     $page = $params['page'];
     if (!$acl) {
         return $accepted;
     }
     $resource = $page->getResource();
     $privilege = $page->getPrivilege();
     if ($resource || $privilege) {
         $accepted = $acl->hasResource($resource) && $acl->userIsAllowed($resource, $privilege);
     }
     $event->stopPropagation();
     return $accepted;
 }
开发者ID:patrova,项目名称:omeka-s,代码行数:23,代码来源:Module.php

示例13: onMailSentError

 /**
  * Callback function invoking on mail sending error
  *
  * @param Event $e
  */
 public function onMailSentError(Event $e)
 {
     /* @var Message */
     $message = $e->getTarget();
     $params = $e->getParams();
     $addressList = $this->prepareAddressList($message);
     $this->logger->err(sprintf("E-mail '%s' has been not sent to following recipients: %s. Error message: %s", $message->getSubject(), implode(', ', $addressList), $params['error_message']));
 }
开发者ID:guliano,项目名称:esco-mail,代码行数:13,代码来源:MailLogger.php

示例14: getParams

 /**
  * Get all event parameters
  *
  * @return array|\ArrayAccess
  */
 public function getParams()
 {
     $params = parent::getParams();
     $params['processor'] = $this->getProcessor();
     $params['message'] = $this->getMessage();
     $params['result'] = $this->getResult();
     return $params;
 }
开发者ID:stakhanovist,项目名称:worker,代码行数:13,代码来源:ProcessEvent.php


注:本文中的Zend\EventManager\Event::getParams方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。