public function toArray()
    {
        $array = array();

        $array['orderNumber'] = $this->orderNumber;
        if (isset($this->referenceNumber)) {
            $array['referenceNumber'] = $this->referenceNumber;
        }
        if (isset($this->description)) {
            $array['description'] = $this->description;
        }
        $array['currency'] = $this->currency;
        if (isset($this->locale)) {
            $array['locale'] = $this->locale;
        }
        $array['orderDetails'] = array(
            'includeVat' => $this->vatMode,
            'products'   => array(),
        );
        if ($this->urlSet !== null) {
            $array['urlSet'] = $this->urlSet->toArray();
        }
        if ($this->contact !== null) {
            $array['orderDetails']['contact'] = $this->contact->toArray();
        }
        foreach ($this->products as $product) {
            $array['orderDetails']['products'][] = $product->toArray();
        }

        return $array;
    }