public function set($id, $definition, $args = null, $factory = false) {
		if (isset($this->_definitions[$id])) {
			throw new Exceptions\ServiceOverride('Service "' . $id . '" already exists');
		}
		
		$definition = $this->normalizeDefinition($definition);
		
		if ($args !== null) {
			$args = $this->processArguments($args);
			$definition->setArguments($args);
		}
		
		if ($factory) {
			$definition->setFactoryMode();
		}
		
		$this->_definitions[$id] = $definition;
		
		return $definition;
	}
public function set($id, $definition, $args = null, $factory = false) {
		if (isset($this->_definitions[$id])) {
			throw new Exceptions\ServiceOverride('Service "' . $id . '" already exists');
		}
		
		$definition = $this->normalizeDefinition($definition);
		
		if ($args !== null) {
			$args = $this->processArguments($args);
			$definition->setArguments($args);
		}
		
		if ($factory) {
			$definition->setFactoryMode();
		}
		
		$this->_definitions[$id] = $definition;
		
		return $definition;
	}
public function set ( $ id , $ definition , $ args = null , $ factory = false ) { if ( isset ( $ this -> _definitions [ $ id ] ) ) { throw new Exceptions \ ServiceOverride ( 'Service "' . $ id . '" already exists' ) ; } $ definition = $ this -> normalizeDefinition ( $ definition ) ; if ( $ args !== null ) { $ args = $ this -> processArguments ( $ args ) ; $ definition -> setArguments ( $ args ) ; } if ( $ factory ) { $ definition -> setFactoryMode ( ) ; } $ this -> _definitions [ $ id ] = $ definition ; return $ definition ; }
Set service definition

@param  string $id         ID of service
@param  mixed  $definition Definition of service
@param  mixed  $args       Arguments for constructor of service
@param  bool   $factory    Factory mode: new instance for each request of service
@return DefinitionInterface
@throws Exceptions\ServiceOverride
Set service definition