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


PHP SplSubject::getArgs方法代碼示例

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


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

示例1: update

 /**
  * Gets data from $_oSubject object
  *
  * @param \SplSubject $_oSubject Action object
  * @return void
  */
 function update(\SplSubject $_oSubject)
 {
     $iMicroSec = $_oSubject->getEndTime() - $_oSubject->getStartTime();
     $iSec = number_format($iMicroSec, 10, '.', ' ');
     $aArguments = $_oSubject->getArgs();
     $xResult = $_oSubject->getResult();
     array_unshift(self::$_aLog, array('action' => get_class($_oSubject), 'time_msec' => $iMicroSec, 'time_sec' => $iSec, 'args' => $aArguments, 'result' => $xResult));
 }
開發者ID:uprinter,項目名稱:Actions,代碼行數:14,代碼來源:ActionsLogger.php

示例2: update

 /**
  * Method to trigger events.
  * The method first generates the even from the argument array. Then it unsets the argument
  * since the argument has no bearing on the event handler.
  * If the method exists it is called and returns its return value. If it does not exist it
  * returns null.
  *
  * @param   array  &$args  Arguments
  *
  * @return  mixed  Routine return value
  */
 public function update(SplSubject $subject)
 {
     // get the event and args from the subject (dispatcher) to use in the plugin
     $event = $subject->getEvent();
     $args = $subject->getArgs();
     /*
      * If the method to handle an event exists, call it and return its value
      * If it does not exist, return null.
      */
     if (method_exists($this, $event)) {
         return call_user_func_array(array($this, $event), $args);
     } else {
         return null;
     }
 }
開發者ID:ngchie,項目名稱:system,代碼行數:26,代碼來源:Observer.php

示例3: update

 /**
  * The required update() function from SplObserver.
  * 
  * @param SplSubjectAdapter The SplSubjectAdapter object.
  * @return void
  */
 public function update(SplSubject $subject)
 {
     call_user_func_array($this->_function, $subject->getArgs());
 }
開發者ID:Burgestrand,項目名稱:phplibs,代碼行數:10,代碼來源:SplSubjectAdapter.php


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