# Shopware\_Models\_Order - Exception in 'getShipping'

**URL:** <https://forum.shopware.com/t/shopware-models-order-exception-in-getshipping/2888>\
**Category:** Shopware 3.5\
**Tags:** general\
**Created:** [24. Mai 2011 um 13:01 UTC](https://forum.shopware.com/t/shopware-models-order-exception-in-getshipping/2888 "2011-05-24T13:01:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![radox1](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@radox1](https://forum.shopware.com/u/radox1)\
**Post date:** [24. Mai 2011 um 13:01 UTC](https://forum.shopware.com/t/shopware-models-order-exception-in-getshipping/2888/1 "2011-05-24T13:01:12Z")

</div>

Hallo, wenn in der Funktion ‘getShipping’ (Klasse ‘Shopware\_Models\_Order’) die Datenbankabfrage kein Ergebnis zurückliefert (= false), wird eine Exception erzeugt. ` public function getShipping(){ $this-\>\_shipping = new ArrayObject(Shopware()-\>Db()-\>fetchRow(" SELECT \* FROM s\_order\_shippingaddress WHERE userID = ? AND orderID = ? ",array($this-\>\_userID,$this-\>\_id)), ArrayObject::ARRAY\_AS\_PROPS); if (!$this-\>\_shipping){ $this-\>\_shipping = clone $this-\>\_billing; }else { if (empty($this-\>\_shipping["countryID"])){ $this-\>\_shipping["countryID"] = $this-\>\_billing["countryID"]; } ` **Fatal error** : Uncaught exception ‘InvalidArgumentException’ with message ‘Passed variable is not an array or object, using empty array instead’ in /…/engine/Shopware/Models/Order.php:404

---

<div class="post-metadata">

**Author:** ![Stefan\_Hamann](https://avatars.discourse-cdn.com/v4/letter/s/5e9695/32.png) [@Stefan\_Hamann](https://forum.shopware.com/u/Stefan_Hamann)\
**Post date:** [24. Mai 2011 um 13:05 UTC](https://forum.shopware.com/t/shopware-models-order-exception-in-getshipping/2888/2 "2011-05-24T13:05:57Z")

</div>

Hey, eigentlich muss die Funktion aber immer ein Ergebnis zurückliefern, da in die Tabelle s\_order\_shippingaddress bei jeder Bestellung ein Eintrag eingefügt wird. Dann müssten bei dir ja einer oder mehrere Einträge fehlen ?

---

<div class="post-metadata">

**Author:** ![radox1](https://avatars.discourse-cdn.com/v4/letter/r/e19b73/32.png) [@radox1](https://forum.shopware.com/u/radox1)\
**Post date:** [24. Mai 2011 um 13:20 UTC](https://forum.shopware.com/t/shopware-models-order-exception-in-getshipping/2888/3 "2011-05-24T13:20:27Z")

</div>

Hallo, das ging aber schnell. Ja, normalerweise sollte das nicht passieren. Teste gerade ein neues (eigenes) Importskript, indem noch ein Fehler war - dabei ist es mir aufgefallen.
