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


PHP sfEvent::getName方法代码示例

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


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

示例1: listenToChanges

 /**
  * index updater event listener
  *
  * @param  sfEvent $event
  */
 public function listenToChanges(sfEvent $event)
 {
     $object = $event['object'];
     $delete_only = in_array($event->getName(), $this->deleteEvents);
     $this->removeFromIndex($object);
     if (!$delete_only) {
         $this->addToIndex($object);
     }
 }
开发者ID:blerou,项目名称:SimpleLucene,代码行数:14,代码来源:ManagerSymfony.php

示例2: filterValue

 public function filterValue(\sfEvent $event, $value)
 {
     $method = $this->eventToMethod($event->getName());
     foreach ($this->plugins as $plugin) {
         if (method_exists($plugin, $method)) {
             $value = $plugin->{$method}($event, $value);
         }
     }
     return $value;
 }
开发者ID:ubermuda,项目名称:PHPInteractiveShell,代码行数:10,代码来源:PluginSet.php

示例3: configure

 protected function configure(sfEvent $event)
 {
     $this->name = $event->getName();
     $this->subject = $event->getSubject();
     $this->arguments = $event->getParameters();
     if (!$this->isEnabledForCurrentProject()) {
         return false;
     }
     return true;
 }
开发者ID:ratibus,项目名称:Crew,代码行数:10,代码来源:BaseNotifier.class.php

示例4: listenToLogEvent

 /**
  * Listens to command.log events.
  *
  * @param sfEvent $event An sfEvent instance
  */
 public function listenToLogEvent(sfEvent $event)
 {
     $priority = isset($event['priority']) ? $event['priority'] : self::INFO;
     $prefix = '';
     if ('application.log' == $event->getName()) {
         $subject = $event->getSubject();
         $subject = is_object($subject) ? get_class($subject) : (is_string($subject) ? $subject : 'main');
         $prefix = '>> ' . $subject . ' ';
     }
     foreach ($event->getParameters() as $message) {
         $this->log(sprintf('%s%s', $prefix, $message), $priority);
     }
 }
开发者ID:habtom,项目名称:uas,代码行数:18,代码来源:sfCommandLogger.class.php

示例5: handleEvent

 public static function handleEvent(sfEvent $event)
 {
     switch ($event->getName()) {
         case 'paypal.ipn_success':
             $transaction = $event->getSubject();
             $message = sprintf('IPN Success | Reservation: %s', $transaction->parent_id);
             self::notifyPaypalEvent($message, $event['ipn_data']);
             break;
         case 'paypal.ipn_error':
             $message = sprintf('IPN Error |  %s', $event->getSubject());
             self::notifyPaypalEvent($message, $event['ipn_data']);
             break;
     }
 }
开发者ID:jmiridis,项目名称:atcsf1,代码行数:14,代码来源:PaypalEventManager.class.php

示例6: handleEvent

 public static function handleEvent(sfEvent $event)
 {
     $reservation = $event->getSubject();
     switch ($event->getName()) {
         case 'reservation.pre_update':
             break;
         case 'reservation.post_update':
             break;
         case 'reservation.created':
             $url = Encryption::getEncryptedUrlFromUri('@reservation_show?uniqid=' . $reservation->uniqid, $reservation->Client->User->id);
             if ($reservation->Client->email_confirmed) {
                 $subject = 'ATC: Reservation Confirmation #' . $reservation->uniqid;
                 $template = 'confirm_reservation';
             } else {
                 $subject = 'ATC: please confirm your reservation';
                 $template = 'request_confirmation';
             }
             $data = array('email_address' => $reservation->Client->email_address, 'subject' => $subject, 'url' => $url, 'reservation' => $reservation);
             self::sendNotification($template, $data);
             break;
     }
 }
开发者ID:jmiridis,项目名称:atcsf1,代码行数:22,代码来源:ReservationEventManager.class.php

示例7: filter

 /**
  * Filters a value by calling all listeners of a given event.
  *
  * @param  sfEvent  $event   A sfEvent instance
  * @param  mixed    $value   The value to be filtered
  *
  * @return sfEvent The sfEvent instance
  */
 public function filter(sfEvent $event, $value)
 {
     foreach ($this->getListeners($event->getName()) as $listener) {
         $value = call_user_func_array($listener, array($event, $value));
     }
     $event->setReturnValue($value);
     return $event;
 }
开发者ID:yankeemedia,项目名称:symfony1,代码行数:16,代码来源:sfEventDispatcher.class.php

示例8: dirname

 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
require_once dirname(__FILE__) . '/../lime/lime.php';
require_once dirname(__FILE__) . '/../../lib/sfEvent.php';
$t = new lime_test(11);
$subject = new stdClass();
$parameters = array('foo' => 'bar');
$event = new sfEvent($subject, 'name', $parameters);
// ->getSubject()
$t->diag('->getSubject()');
$t->is($event->getSubject(), $subject, '->getSubject() returns the event subject');
// ->getName()
$t->diag('->getName()');
$t->is($event->getName(), 'name', '->getName() returns the event name');
// ->getParameters()
$t->diag('->getParameters()');
$t->is($event->getParameters(), $parameters, '->getParameters() returns the event parameters');
// ->getReturnValue() ->setReturnValue()
$t->diag('->getReturnValue() ->setReturnValue()');
$event->setReturnValue('foo');
$t->is($event->getReturnValue(), 'foo', '->getReturnValue() returns the return value of the event');
// ->setProcessed() ->isProcessed()
$t->diag('->setProcessed() ->isProcessed()');
$event->setProcessed(true);
$t->is($event->isProcessed(), true, '->isProcessed() returns true if the event has been processed');
$event->setProcessed(false);
$t->is($event->isProcessed(), false, '->setProcessed() changes the processed status');
// ArrayAccess interface
$t->diag('ArrayAccess interface');
开发者ID:ubermuda,项目名称:PHPInteractiveShell,代码行数:31,代码来源:sfEventTest.php

示例9: listenToLogEvent

 /**
  * Overridden command.log event so we can surpress the output of other
  * tasks as we want to.
  * 
  * This checks on the _showLog property to see if it should really report
  * the log to the true listeners
  */
 public function listenToLogEvent(sfEvent $event)
 {
     // 41 is the red error color, if it is in the string, assume error and report
     $isError = strpos($event[0], '41;') !== false;
     if ($this->_showLog || $isError) {
         if ($event->getName() == 'command.log') {
             foreach ($this->_commandLogListeners as $listener) {
                 call_user_func($listener, $event);
             }
         } elseif ($event->getName() == 'application.log') {
             if ($this->_consoleApplicationLogger) {
                 call_user_func($this->_consoleApplicationLogger, $event);
             }
         }
     }
 }
开发者ID:sympal,项目名称:sympal,代码行数:23,代码来源:sfSympalInstall.class.php


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