@@ 72-85 (lines=14) @@ | ||
69 | /** |
|
70 | * {@inheritdoc} |
|
71 | */ |
|
72 | public function current() |
|
73 | { |
|
74 | $value = parent::current(); |
|
75 | ||
76 | // Generate objects on demand |
|
77 | if ($value === null && $this->valid()) { |
|
78 | $key = $this->key(); |
|
79 | $value = $this->convertDocument($this->rawObjects[$key]); |
|
80 | $this->rawObjects[$key] = null; |
|
81 | $this->offsetSet($key, $value); |
|
82 | } |
|
83 | ||
84 | return $value; |
|
85 | } |
|
86 | ||
87 | /** |
|
88 | * {@inheritdoc} |
|
@@ 90-102 (lines=13) @@ | ||
87 | /** |
|
88 | * {@inheritdoc} |
|
89 | */ |
|
90 | public function offsetGet($offset) |
|
91 | { |
|
92 | $value = parent::offsetGet($offset); |
|
93 | ||
94 | // Generate objects on demand |
|
95 | if ($value === null && $this->valid()) { |
|
96 | $value = $this->convertDocument($this->rawObjects[$offset]); |
|
97 | $this->rawObjects[$offset] = null; |
|
98 | $this->offsetSet($offset, $value); |
|
99 | } |
|
100 | ||
101 | return $value; |
|
102 | } |
|
103 | } |
|
104 |