public function runAs($role, $callback, $args = array()) { if (!$callback instanceof CallbackHandler) { $callback = new CallbackHandler($callback); } $this->setTempRole($role); //execute $ret = $callback->call($args); $this->rollbackTempRole(); return $ret; }
/** * Returns the total number of items. * * Executes the {$countCallback}. * * @return int */ public function count() { return $this->countCallback->call(); }
public function run() { return $this->callback->call($this->params); }
public function testClosureCallbackShouldBeInvokedByCall() { $handler = new CallbackHandler(null, function () { return 'foo'; }); $this->assertEquals('foo', $handler->call()); }
public function __c_callback_handle($callback = null, array $metadata = array()) { $oCallbackHandle = new CallbackHandler($callback); return $oCallbackHandle->call($metadata); }