Back to BeforeBindEvent class

Method setSrc

protected mixed
setSrc
(mixed $value)
Setter for the src argument
Parameters
  • mixed $value The value to set
Returns
  • mixed
-
  • \BadMethodCallException if the argument is not of the expected type

Method setSrc - Source code

/**
 * Setter for the src argument
 *
 * @param   mixed  $value  The value to set
 *
 * @return  mixed
 *
 * @throws  BadMethodCallException  if the argument is not of the expected type
 */
protected function setSrc($value)
{
    if (!empty($value) && !\is_object($value) && !\is_array($value)) {
        throw new BadMethodCallException("Argument 'src' of event {$this->name} must be empty, object or array");
    }
    return $value;
}