1818namespace MongoDB \Model ;
1919
2020use ArrayIterator ;
21+ use MongoDB \Exception \BadMethodCallException ;
2122
2223/**
2324 * Iterator for applying a type map to documents in inline command results.
@@ -46,6 +47,28 @@ public function __construct(array $documents = [], array $typeMap)
4647 $ this ->typeMap = $ typeMap ;
4748 }
4849
50+ /**
51+ * Not supported.
52+ *
53+ * @see http://php.net/arrayiterator.append
54+ * @throws BadMethodCallException
55+ */
56+ public function append ($ value )
57+ {
58+ throw BadMethodCallException::classIsImmutable (__CLASS__ );
59+ }
60+
61+ /**
62+ * Not supported.
63+ *
64+ * @see http://php.net/arrayiterator.asort
65+ * @throws BadMethodCallException
66+ */
67+ public function asort ()
68+ {
69+ throw BadMethodCallException::classIsImmutable (__CLASS__ );
70+ }
71+
4972 /**
5073 * Return the current element with the type map applied to it.
5174 *
@@ -56,4 +79,93 @@ public function current()
5679 {
5780 return \MongoDB \apply_type_map_to_document (parent ::current (), $ this ->typeMap );
5881 }
82+
83+ /**
84+ * Not supported.
85+ *
86+ * @see http://php.net/arrayiterator.ksort
87+ * @throws BadMethodCallException
88+ */
89+ public function ksort ()
90+ {
91+ throw BadMethodCallException::classIsImmutable (__CLASS__ );
92+ }
93+
94+ /**
95+ * Not supported.
96+ *
97+ * @see http://php.net/arrayiterator.natcasesort
98+ * @throws BadMethodCallException
99+ */
100+ public function natcasesort ()
101+ {
102+ throw BadMethodCallException::classIsImmutable (__CLASS__ );
103+ }
104+
105+ /**
106+ * Not supported.
107+ *
108+ * @see http://php.net/arrayiterator.natsort
109+ * @throws BadMethodCallException
110+ */
111+ public function natsort ()
112+ {
113+ throw BadMethodCallException::classIsImmutable (__CLASS__ );
114+ }
115+
116+ /**
117+ * Return the value from the provided offset with the type map applied.
118+ *
119+ * @see http://php.net/arrayiterator.offsetget
120+ * @param mixed $offset
121+ * @return array|object
122+ */
123+ public function offsetGet ($ offset )
124+ {
125+ return \MongoDB \apply_type_map_to_document (parent ::offsetGet ($ offset ), $ this ->typeMap );
126+ }
127+
128+ /**
129+ * Not supported.
130+ *
131+ * @see http://php.net/arrayiterator.offsetset
132+ * @throws BadMethodCallException
133+ */
134+ public function offsetSet ($ index , $ newval )
135+ {
136+ throw BadMethodCallException::classIsImmutable (__CLASS__ );
137+ }
138+
139+ /**
140+ * Not supported.
141+ *
142+ * @see http://php.net/arrayiterator.offsetunset
143+ * @throws BadMethodCallException
144+ */
145+ public function offsetUnset ($ index )
146+ {
147+ throw BadMethodCallException::classIsImmutable (__CLASS__ );
148+ }
149+
150+ /**
151+ * Not supported.
152+ *
153+ * @see http://php.net/arrayiterator.uasort
154+ * @throws BadMethodCallException
155+ */
156+ public function uasort ($ cmp_function )
157+ {
158+ throw BadMethodCallException::classIsImmutable (__CLASS__ );
159+ }
160+
161+ /**
162+ * Not supported.
163+ *
164+ * @see http://php.net/arrayiterator.uksort
165+ * @throws BadMethodCallException
166+ */
167+ public function uksort ($ cmp_function )
168+ {
169+ throw BadMethodCallException::classIsImmutable (__CLASS__ );
170+ }
59171}
0 commit comments