Hi,

i have made a little change to the sfCallable to pass arguments to the
called function.

Could you please add the changes to the repository ?

Thanks , Ogün

class sfCallable
{
  protected
    $callable = null;
  protected
    $arguments = null;


  /**
   * Constructor.
   *
   * @param mixed $callable  A valid PHP callable (must be valid when
calling the call() method)
   */
  public function __construct($callable, $arguments = array())
  {
    $this->callable = $callable;
    $this->arguments = $arguments;
  }

  /**
   * Returns the current callable.
   *
   * @param mixed The current callable
   */
  public function getCallable()
  {
    return $this->callable;
  }

  /**
   * Calls the current callable with the given arguments.
   *
   * The callable is called with the arguments given to this method.
   *
   * This method throws an exception if the callable is not valid.
   * This check is not done during the object construction to allow
   * you to load the callable as late as possible.
   */
  public function call()
  {
    if (!is_callable($this->callable))
    {
      throw new sfException(sprintf('"%s" is not a valid callable.',
is_array($this->callable) ? sprintf('%s:%s', is_object($this-
>callable[0]) ? get_class($this->callable[0]) : $this->callable[0],
$this->callable[1]) : var_export($this->callable, true)));
    }

    return call_user_func_array($this->callable, $this->arguments);
  }
}
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/symfony-devs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to