Blame view

src/InputOutput/IHMImpl/Params/GeneratorImpl/IHMInputOutputParamsGeneratorClass.php 1.18 KB
3493f196   Benjamin Renard   Add request to ge...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php

/**
 * @class IHMInputOutputParamsGeneratorClass
 * @brief Implementation of IHMInputOutputParamsAbstractClass to treat params generation request
 * @details
*/
class IHMInputOutputParamsGeneratorClass extends IHMInputOutputParamsAbstractClass
{
	/*
	 * @brief method to unmarshall a params generation request
	*/
	protected function unmarshallRequest($input)
	{
		$this->paramsData->setRequestType(ParamsRequestTypeEnumClass::PARAMGEN);
		
		$this->paramsData->setParamId($input->paramId);
2dc32857   Benjamin Renard   Disable batch mod...
18
19

		$this->paramsData->setBatchEnable(FALSE);
3493f196   Benjamin Renard   Add request to ge...
20
		
bf27ba04   Benjamin Renard   Add templated par...
21
		$paramInfo = $this->paramManager->addExistingParam($input->paramId, $this->paramsData);
3493f196   Benjamin Renard   Add request to ge...
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45

		return $this->paramsData;
	}

	/*
	 * @brief method to marshall the result of a download request
	*/
	protected function marshallResult($data)
	{
		if (!$data->getSuccess())
			return array(
					'success' => false,
					'message' => $data->getParamId() . " : " . $data->getLastErrorMessage());
		
		if ($data->getErrorCode() != 0)
			return array(
					'success' => false,
					'message' => $data->getParamId() . " : " . 'Error detected during parameter compilation');
		
		return array(
			'success' => true
		);
	}
}
2dc32857   Benjamin Renard   Disable batch mod...
46
?>