blob: f36fafaf9d08a13f039a405b82a09e1d2929d941 (
plain)
1
2
3
4
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
|
<?php
/**
* Description of ExecutionParameters
*
* @author andrew
*/
class SSRS_Object_ReportParameter extends SSRS_Object_Abstract {
public function __construct($name, $value) {
$this->name = $name;
$this->value = $value;
}
public $name;
public $value;
public function getDefaultValue() {
$defaults = array();
if (key_exists('DefaultValues', $this->data)) {
$defaults = (array) $this->data['DefaultValues']->Value;
}
$validValues = array();
foreach ($this->getValidValues() AS $validValue) {
$validValues[] = $validValue->Value;
}
$validDefaults = array_intersect($defaults, $validValues);
return $validDefaults;
}
public function getValidValues() {
$data = array();
if (key_exists('ValidValues', $this->data)) {
$data = array();
if (is_object($this->data['ValidValues']->ValidValue)) {
$data[] = new SSRS_Object_ReportParameter_ValidValue($this->data['ValidValues']->ValidValue->Label,
$this->data['ValidValues']->ValidValue->Value);
} else {
foreach ($this->data['ValidValues']->ValidValue AS $value) {
if (is_object($value)) {
$data[] = new SSRS_Object_ReportParameter_ValidValue($value->Label, $value->Value);
} else {
$data[] = new SSRS_Object_ReportParameter_ValidValue((string) $value, (string) $value);
}
}
}
// if (!empty($this->data['AllowBlank'])) {
// $data[] = new SSRS_Object_ReportParameter_ValidValue('', '');
// }
}
return $data;
}
public function hasDependencies() {
return (isset($this->data['Dependencies']->Dependency)
&& !empty($this->data['Dependencies']->Dependency));
}
public function getDependencies() {
return (array) $this->data['Dependencies']->Dependency;
}
public function hasOutstandingDependencies() {
return ($this->getState() == 'HasOutstandingDependencies');
}
public function getState() {
return key_exists('State', $this->data) ? $this->data['State'] : null;
}
public function isMultiValue() {
return !empty($this->data['MultiValue']);
}
}
|