Exemple #1
0
 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;
 }
Exemple #2
0
 /**
  * Returns the total number of items.
  *
  * Executes the {$countCallback}.
  *
  * @return int
  */
 public function count()
 {
     return $this->countCallback->call();
 }
Exemple #3
0
 public function run()
 {
     return $this->callback->call($this->params);
 }
 public function testClosureCallbackShouldBeInvokedByCall()
 {
     $handler = new CallbackHandler(null, function () {
         return 'foo';
     });
     $this->assertEquals('foo', $handler->call());
 }
Exemple #5
0
 public function __c_callback_handle($callback = null, array $metadata = array())
 {
     $oCallbackHandle = new CallbackHandler($callback);
     return $oCallbackHandle->call($metadata);
 }