當前位置: 首頁>>代碼示例>>PHP>>正文


PHP GenericEvent::getArguments方法代碼示例

本文整理匯總了PHP中Symfony\Component\EventDispatcher\GenericEvent::getArguments方法的典型用法代碼示例。如果您正苦於以下問題:PHP GenericEvent::getArguments方法的具體用法?PHP GenericEvent::getArguments怎麽用?PHP GenericEvent::getArguments使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Symfony\Component\EventDispatcher\GenericEvent的用法示例。


在下文中一共展示了GenericEvent::getArguments方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: onRoutePage

 /**
  * Fill template engine context with informations about current page.
  *
  * @param GenericEvent $event
  */
 public function onRoutePage(GenericEvent $event)
 {
     $em = $this->registryManager->getManager();
     $page = $em->getRepository('SWP\\ContentBundle\\Model\\Page')->getById($event->getArguments()['pageId'])->getArrayResult();
     if (count($page)) {
         $page[0]['route_name'] = $event->getArguments()['route_name'];
         $this->context->setCurrentPage($page[0]);
     }
     return;
 }
開發者ID:copyfun,項目名稱:web-renderer,代碼行數:15,代碼來源:RoutePageListener.php

示例2: update

 /**
  * Update community ticker
  *
  * @param  GenericEvent $event
  * @return void
  */
 public function update(GenericEvent $event)
 {
     $params = $event->getArguments();
     $user = array_key_exists('user', $params) ? $params['user'] : null;
     unset($params['user']);
     $this->getRepository()->save(new CommunityTickerEvent(), array('event' => $event->getName(), 'user' => $user, 'params' => $params));
 }
開發者ID:sourcefabric,項目名稱:newscoop,代碼行數:13,代碼來源:CommunityFeedService.php

示例3: testGetArguments

 /**
  * Tests Event->getArgs()
  */
 public function testGetArguments()
 {
     // test getting all
     $this->assertSame(array('name' => 'Event'), $this->event->getArguments());
 }
開發者ID:carlyns,項目名稱:RESUSblog,代碼行數:8,代碼來源:GenericEventTest.php

示例4: updateUserPoints

 /**
  * Update user points
  *
  * @param  GenericEvent $event
  * @return void
  */
 public function updateUserPoints(GenericEvent $event)
 {
     $params = $event->getArguments();
     $user = null;
     $authorId = null;
     if (array_key_exists('user', $params)) {
         $user = $params['user'];
         if (is_numeric($params['user'])) {
             $user = $this->find($params['user']);
         }
     }
     if (array_key_exists('authorId', $params)) {
         $authorId = $params['authorId'];
     }
     if ($user || $authorId) {
         $this->getRepository()->setUserPoints($user, $authorId);
     }
 }
開發者ID:sourcefabric,項目名稱:newscoop,代碼行數:24,代碼來源:UserService.php

示例5: add

 public function add(GenericEvent $event, $eventName, EventDispatcherInterface $dispatcher)
 {
     self::$calls[] = [get_class($event->getSubject()), $event->getArguments()];
 }
開發者ID:GrizliK1988,項目名稱:symfony-certification-prepare-project,代碼行數:4,代碼來源:ServiceCallsStatistics.php

示例6: isCallable

 /**
  * Checks whether a eventConfig is appropriate to be called (subject fits, condition fits)
  *
  * @param Event $eventConfig
  * @param GenericEvent $event
  * @return bool
  */
 public function isCallable(Event $eventConfig, GenericEvent $event)
 {
     if ($eventConfig->getSubject() && $event->getSubject() != $eventConfig->getSubject()) {
         return false;
     }
     if ($eventConfig->getCondition()) {
         $args = $event->getArguments() ?: [];
         if ($eventConfig->getCondition() && !$this->conditionOperator->satisfy($eventConfig->getCondition(), $args)) {
             return false;
         }
     }
     return true;
 }
開發者ID:jarves,項目名稱:jarves,代碼行數:20,代碼來源:JarvesEventDispatcher.php


注:本文中的Symfony\Component\EventDispatcher\GenericEvent::getArguments方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。