@@ -60,6 +60,11 @@ class MonetaryAccount extends BunqModel implements AnchorObjectInterface
6060 */
6161 protected $ monetaryAccountExternal ;
6262
63+ /**
64+ * @var MonetaryAccountInvestment
65+ */
66+ protected $ monetaryAccountInvestment ;
67+
6368 /**
6469 * Get a specific MonetaryAccount.
6570 *
@@ -208,6 +213,25 @@ public function setMonetaryAccountExternal($monetaryAccountExternal)
208213 $ this ->monetaryAccountExternal = $ monetaryAccountExternal ;
209214 }
210215
216+ /**
217+ * @return MonetaryAccountInvestment
218+ */
219+ public function getMonetaryAccountInvestment ()
220+ {
221+ return $ this ->monetaryAccountInvestment ;
222+ }
223+
224+ /**
225+ * @deprecated User should not be able to set values via setters, use
226+ * constructor.
227+ *
228+ * @param MonetaryAccountInvestment $monetaryAccountInvestment
229+ */
230+ public function setMonetaryAccountInvestment ($ monetaryAccountInvestment )
231+ {
232+ $ this ->monetaryAccountInvestment = $ monetaryAccountInvestment ;
233+ }
234+
211235 /**
212236 * @return BunqModel
213237 * @throws BunqException
@@ -234,6 +258,10 @@ public function getReferencedObject()
234258 return $ this ->monetaryAccountExternal ;
235259 }
236260
261+ if (!is_null ($ this ->monetaryAccountInvestment )) {
262+ return $ this ->monetaryAccountInvestment ;
263+ }
264+
237265 throw new BunqException (self ::ERROR_NULL_FIELDS );
238266 }
239267
@@ -262,6 +290,10 @@ public function isAllFieldNull()
262290 return false ;
263291 }
264292
293+ if (!is_null ($ this ->monetaryAccountInvestment )) {
294+ return false ;
295+ }
296+
265297 return true ;
266298 }
267299}
0 commit comments