public function setParameterViaConstructor($instanceName, $index, $paramValue, $parameterType, $type = "string", array $metadata = array()) {
		if ($type != "string" && $type != "config" && $type != "request" && $type != "session" && $type != "php") {
			throw new MoufContainerException("Invalid type. Must be one of: string|config|request|session");
		}

		$this->declaredInstances[$instanceName]['constructor'][$index]["value"] = $paramValue;
		$this->declaredInstances[$instanceName]['constructor'][$index]["parametertype"] = $parameterType;
		$this->declaredInstances[$instanceName]['constructor'][$index]["type"] = $type;
		$this->declaredInstances[$instanceName]['constructor'][$index]["metadata"] = $metadata;
		
		// Now, let's make sure that all indexes BEFORE ours are set, and let's order everything by key.
		for ($i=0; $i<$index; $i++) {
			if (!isset($this->declaredInstances[$instanceName]['constructor'][$i])) {
				// If the parameter before does not exist, let's set it to null.
				$this->declaredInstances[$instanceName]['constructor'][$i]["value"] = null;
				$this->declaredInstances[$instanceName]['constructor'][$i]["parametertype"] = "primitive";
				$this->declaredInstances[$instanceName]['constructor'][$i]["type"] = "string";
				$this->declaredInstances[$instanceName]['constructor'][$i]["metadata"] = array();
			}
		}
		ksort($this->declaredInstances[$instanceName]['constructor']);
	}