public function with($serviceClassName)
    {
        if (false === $this->has($serviceClassName)) {
            throw new Exception(
                'You cannot use the function "' . __FUNCTION__ . '" on a service which was not added to the factory (service used: "' . $serviceClassName . '").',
                1459425398
            );
        }

        $this->currentService = $serviceClassName;

        return $this;
    }
public function with($serviceClassName)
    {
        if (false === $this->has($serviceClassName)) {
            throw new Exception(
                'You cannot use the function "' . __FUNCTION__ . '" on a service which was not added to the factory (service used: "' . $serviceClassName . '").',
                1459425398
            );
        }

        $this->currentService = $serviceClassName;

        return $this;
    }
public function with ( $ serviceClassName ) { if ( false === $ this -> has ( $ serviceClassName ) ) { throw new Exception ( 'You cannot use the function "' . __FUNCTION__ . '" on a service which was not added to the factory (service used: "' . $ serviceClassName . '").' , 1459425398 ) ; } $ this -> currentService = $ serviceClassName ; return $ this ; }
Resets the current service value to the given service, allowing the usage
of the function `setOption` with this service.

@param string $serviceClassName The class name of the service which will be saved as "current service".
@return $this
@throws Exception
Resets the current service value to the given service allowing the usage of the function setOption with this service .