sfContext::__call PHP Method

__call() public method

If a method cannot be found via sfEventDispatcher, the method name will be parsed to magically handle getMyFactory() and setMyFactory() methods.
public __call ( string $method, array $arguments ) : mixed
$method string The method name
$arguments array The method arguments
return mixed The returned value of the called method
    public function __call($method, $arguments)
    {
        $event = $this->dispatcher->notifyUntil(new sfEvent($this, 'context.method_not_found', array('method' => $method, 'arguments' => $arguments)));
        if (!$event->isProcessed()) {
            $verb = substr($method, 0, 3);
            // get | set
            $factory = strtolower(substr($method, 3));
            // factory name
            if ('get' == $verb && $this->has($factory)) {
                return $this->factories[$factory];
            } else {
                if ('set' == $verb && isset($arguments[0])) {
                    return $this->set($factory, $arguments[0]);
                }
            }
            throw new sfException(sprintf('Call to undefined method %s::%s.', get_class($this), $method));
        }
        return $event->getReturnValue();
    }