1 | <?php |
||
20 | abstract class ProcessorA extends BaseObject implements ProcessorInterface { |
||
21 | private $oCurrentMap; |
||
22 | protected $aLocalVars = array(); |
||
23 | |||
24 | /** |
||
25 | * @returns ClassMap |
||
26 | */ |
||
27 | 3 | public function getMap() { |
|
35 | |||
36 | /** |
||
37 | * @param MappingA $oMap |
||
38 | */ |
||
39 | 10 | public function setMap(MappingA $oMap) { |
|
40 | 10 | $this->oCurrentMap = $oMap; |
|
41 | 10 | $aTainted = $oMap->getTaintedVars(); |
|
42 | 10 | if (is_array($aTainted) && count($aTainted) >= 1) { |
|
43 | $this->setLocalVars($aTainted); |
||
44 | } |
||
45 | 10 | } |
|
46 | |||
47 | /** |
||
48 | * |
||
49 | * @param array $aVars |
||
50 | * @param bool $bPreserveKeys |
||
51 | * @return void |
||
52 | */ |
||
53 | 1 | public function setLocalVars($aVars = array(), $bPreserveKeys = false) { |
|
54 | 1 | if ($bPreserveKeys) { |
|
55 | 1 | $this->aLocalVars = array_merge($this->aLocalVars, $aVars); |
|
56 | } else { |
||
57 | // This needs improvement to take into account incoming arrays |
||
58 | // containing both string keys - which exist or not in the $aLocalVars array |
||
59 | // and numeric indexes |
||
60 | foreach ($this->aLocalVars as $sKey => $sValue) { |
||
61 | $this->aLocalVars[$sKey] = array_shift($aVars); |
||
62 | } |
||
63 | } |
||
64 | 1 | } |
|
65 | |||
66 | /** |
||
67 | * @return array |
||
68 | */ |
||
69 | 1 | public function getLocalVars() { |
|
72 | |||
73 | /** |
||
74 | * @param string $sVar |
||
75 | * @param string $sValue |
||
76 | * @return bool |
||
77 | */ |
||
78 | 2 | public function setVar($sVar, $sValue) { |
|
85 | |||
86 | /** |
||
87 | * @param string $sVar |
||
88 | * @return null |
||
89 | */ |
||
90 | 1 | public function getVar($sVar) { |
|
97 | |||
98 | /** |
||
99 | * |
||
100 | * @see ProcessorI::delegateRequest() |
||
101 | * @param HttpRequestA $oHttpRequest |
||
102 | * @param ProcessorA $oNewProcessor |
||
103 | * @param HttpResponseA $oResponse |
||
104 | * @returns ModelA |
||
105 | */ |
||
106 | 1 | public function delegateRequest(HttpRequestA $oHttpRequest, ProcessorA $oNewProcessor, HttpResponseA $oResponse = null) { |
|
128 | } |
||
129 |