public function addResource(ResourceInterface $resource, $name = null) {
		if ($name === null) {
			$this->resources[] = $resource;
			
			return $this;
		}
		
		$this->resources[$name] = $resource;
		
		return $this;
	}
public function addResource(ResourceInterface $resource, $name = null) {
		if ($name === null) {
			$this->resources[] = $resource;
			
			return $this;
		}
		
		$this->resources[$name] = $resource;
		
		return $this;
	}
public function addResource ( ResourceInterface $ resource , $ name = null ) { if ( $ name === null ) { $ this -> resources [ ] = $ resource ; return $ this ; } $ this -> resources [ $ name ] = $ resource ; return $ this ; }
Add the resource

@param  string            $name     Optional name of the resource, will override the exists one
@param  ResourceInterface $resource
@return Translator
Add the resource