本文整理汇总了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));
}
示例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;
}
}
示例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());
}