Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
0.00% covered (danger)
0.00%
0 / 31
0.00% covered (danger)
0.00%
0 / 8
CRAP
0.00% covered (danger)
0.00%
0 / 1
ResultStorageWrapper
0.00% covered (danger)
0.00%
0 / 31
0.00% covered (danger)
0.00%
0 / 8
72
0.00% covered (danger)
0.00%
0 / 1
 __construct
0.00% covered (danger)
0.00%
0 / 2
0.00% covered (danger)
0.00%
0 / 1
2
 getResultServer
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 getDeliveryExecutionIdentifier
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
 storeItemVariable
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 1
2
 storeItemVariables
0.00% covered (danger)
0.00%
0 / 7
0.00% covered (danger)
0.00%
0 / 1
2
 storeTestVariable
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
2
 storeTestVariables
0.00% covered (danger)
0.00%
0 / 6
0.00% covered (danger)
0.00%
0 / 1
2
 getWritableStorage
0.00% covered (danger)
0.00%
0 / 1
0.00% covered (danger)
0.00%
0 / 1
2
1<?php
2
3/**
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License
6 * as published by the Free Software Foundation; under version 2
7 * of the License (non-upgradable).
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17 *
18 * Copyright (c) 2017 (original work) Open Assessment Technologies SA (under the project TAO-PRODUCT);
19 *
20 */
21
22namespace oat\taoResultServer\models\classes;
23
24class ResultStorageWrapper
25{
26    /**
27     * @var string
28     */
29    private $deliveryExecutionIdentifier;
30
31    /**
32     * @var \taoResultServer_models_classes_WritableResultStorage
33     */
34    protected $resultServer;
35
36    /**
37     * ResultStorageWrapper constructor.
38     * @param string $deliveryExecutionIdentifier
39     * @param \taoResultServer_models_classes_WritableResultStorage $resultServer
40     */
41    public function __construct(
42        $deliveryExecutionIdentifier,
43        \taoResultServer_models_classes_WritableResultStorage $resultServer
44    ) {
45        $this->deliveryExecutionIdentifier = $deliveryExecutionIdentifier;
46        $this->resultServer = $resultServer;
47    }
48
49    protected function getResultServer()
50    {
51        return $this->resultServer;
52    }
53
54    /**
55     * @return string
56     */
57    protected function getDeliveryExecutionIdentifier()
58    {
59        return $this->deliveryExecutionIdentifier;
60    }
61
62    /** @see  \taoResultServer_models_classes_WritableResultStorage::storeItemVariable() */
63    public function storeItemVariable($test, $item, \taoResultServer_models_classes_Variable $itemVariable, $callIdItem)
64    {
65        return $this->getWritableStorage()->storeItemVariable(
66            $this->getDeliveryExecutionIdentifier(),
67            $test,
68            $item,
69            $itemVariable,
70            $callIdItem
71        );
72    }
73
74    /** @see  \taoResultServer_models_classes_WritableResultStorage::storeItemVariables() */
75    public function storeItemVariables($test, $item, array $itemVariables, $callIdItem)
76    {
77        return $this->getWritableStorage()->storeItemVariables(
78            $this->getDeliveryExecutionIdentifier(),
79            $test,
80            $item,
81            $itemVariables,
82            $callIdItem
83        );
84    }
85
86    /** @see  \taoResultServer_models_classes_WritableResultStorage::storeTestVariable() */
87    public function storeTestVariable($test, \taoResultServer_models_classes_Variable $testVariable, $callIdTest)
88    {
89        return $this->getWritableStorage()->storeTestVariable(
90            $this->getDeliveryExecutionIdentifier(),
91            $test,
92            $testVariable,
93            $callIdTest
94        );
95    }
96
97    /** @see  \taoResultServer_models_classes_WritableResultStorage::storeTestVariables() */
98    public function storeTestVariables($test, array $testVariables, $callIdTest)
99    {
100        return $this->getWritableStorage()->storeTestVariables(
101            $this->getDeliveryExecutionIdentifier(),
102            $test,
103            $testVariables,
104            $callIdTest
105        );
106    }
107
108    /**
109     * @return \taoResultServer_models_classes_WritableResultStorage
110     */
111    protected function getWritableStorage()
112    {
113        return $this->getResultServer();
114    }
115}