* @package SysAl.AlarmManagement.DataType */ class InstAddr { /** * selector: * @var InstAddrSel */ private $selector; /** * value * @var string */ private $value; /** * constructor: checks validity * * @param strOrSel both constructions possible: with complete string or by selector/value pair * @param value only if selector/value are specified separately */ function __construct($strOrSel, $value = null){ if ($value == null) { $aux_arr = explode ('/', $strOrSel); if (count($aux_arr) != 2) throw new Exception("Invalid InstAddr string: $strOrSel"); } else { $aux_arr[0] = $strOrSel; $aux_arr[1] = $value; } $this->selector = new InstAddrSel($aux_arr[0]); $this->value = $aux_arr[1]; } function getSelector(){ return $this->selector; } function getValue(){ return $this->value; } function __toString(){ return $this->selector . "/" . $this->value; } }