本文整理匯總了PHP中Call::apply方法的典型用法代碼示例。如果您正苦於以下問題:PHP Call::apply方法的具體用法?PHP Call::apply怎麽用?PHP Call::apply使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Call
的用法示例。
在下文中一共展示了Call::apply方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: push
/**
* Add a Call object to the CallChain
*
* @param mixed $call Either a Call object, or a table name (from which a Call object will be created)
* @param array $plugins (Optional) An array of plugins
*
* @return void
*/
public function push($call, array $plugins = array())
{
if (! ($call instanceof Call))
{
$table = (string) $call;
$call = new Call();
$call->table = $table;
}
foreach ($plugins as $plugin)
{
$call->apply($plugin);
}
$this->_calls[] = $call;
return;
}
示例2: Me
public function Me()
{
$plugins = func_get_args();
if (empty($plugins))
{
return $this; // shortcut
}
$cluster = new Cluster($this->_callChain);
$call = new Call();
foreach ($plugins as $plugin)
{
$call->apply($plugin);
}
$cluster->_callChain->push($call, $plugins);
return $cluster;
}