Blame view

src/Request/ParamsRequestImpl/Nodes/Params/ParamGetLocalBaseNodeClass.php 1.42 KB
944199fe   Benjamin Renard   Use table definit...
1
2
<?php

966bd5f8   Benjamin Renard   Add request to ge...
3
4
require_once "ParamGetLocalBaseParamNodeClass.php";

944199fe   Benjamin Renard   Use table definit...
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
define ("PARAMGETLOCALBASE_VI", "localvi");
define ("PARAMGETLOCALBASE_VIID", "id");

/**
 * @class ParamGetLocalBaseNodeClass
 * @brief Definition of a local base getter for AMDA_Kernel
 * @details
*/
class ParamGetLocalBaseNodeClass extends NodeClass
{
	public function __construct()
	{
		parent::__construct(PARAMGETLOCALBASE_VI);
	}

	public function setVIId($id)
	{
		$this->setAttribute(PARAMGETLOCALBASE_VIID, $id);
	}

	public function getLocalParam($id)
	{
		$nodes = $this->getChildrenByName(PARAMGETLOCALBASEPARAM_NAME);
	
		foreach ($nodes as $node)
		if ($node->getId() == $id)
			return $node;
		return NULL;
	}
	
e8ff4ba7   Elena.Budnik   integration of as...
35
	public function addLocalParam($id = "", $minSampling = "", $maxSampling = "", $parameterType = "", $parameterSize = "")
944199fe   Benjamin Renard   Use table definit...
36
37
38
39
40
41
	{
		$paramNode = new ParamGetLocalBaseParamNodeClass();
		
		$paramNode->setId($id);
		$paramNode->setMinSampling($minSampling);
		$paramNode->setMaxSampling($maxSampling);
e8ff4ba7   Elena.Budnik   integration of as...
42
43
		$paramNode->setParameterType($parameterType);
		$paramNode->setParameterSize($parameterSize);
944199fe   Benjamin Renard   Use table definit...
44
45
		
		$this->addChild($paramNode);
966bd5f8   Benjamin Renard   Add request to ge...
46
47
48
49
50
51
52
53
54
55
56
		
		return $paramNode;
	}
	
	public function loadFromNode($xmlNode)
	{
		$this->setVIId($this->getXmlNodeAttribute($xmlNode, PARAMGETLOCALBASE_VIID));
	
		foreach ($this->getXmlNodeChildrenByTagName($xmlNode, PARAMGETLOCALBASEPARAM_NAME) as $localParamXmlNode) {
			$this->addLocalParam()->loadFromNode($localParamXmlNode);
		}
944199fe   Benjamin Renard   Use table definit...
57
58
59
60
	}
}

?>