summaryrefslogtreecommitdiffstats
path: root/library/SSRS/Object/ExecutionInfo.php
blob: 97c74f95fab45a8b7c587ebb5a2d9a6c7bd56a23 (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
<?php

/**
 * SSRS_Object_Abstract
 *
 * @author arron
 */
class SSRS_Object_ExecutionInfo extends SSRS_Object_Abstract {

    /**
     * Copy of self for backwards compatibility
     * 
     * @var SSRS_Object_ExecutionInfo
     */
    public $executionInfo;
    
    public function __construct(stdClass $info) {
        $this->setData($info->executionInfo);
        $this->executionInfo = $this;
    }

    public function setParameters(stdClass $params) {
        return $this->setReportParameters($params);
    }

    public function setReportParameters(stdClass $params) {
        $parameters = array();
        foreach ($params->ReportParameter AS $reportParam) {
            $parameter = new SSRS_Object_ReportParameter($reportParam->Name, isset($reportParam->Value) ? $reportParam->Value : null);
            $parameter->setData($reportParam);

            $parameters[] = $parameter;
        }

        $this->data['ReportParameters'] = $parameters;
        return $this;
    }

    /**
     * Returns all report parameters in an array
     * 
     * @return array parameters 
     * 
     */
    public function getReportParameters() {
        return $this->data['ReportParameters'];
    }

}