public function toArray($deep = true) {

        // Get each property
        $array = array();
        foreach ($this->__getSerialisablePropertyMap() as $key => $value) {
            if ($value instanceof AssociativeArray) {
                $array[$key] = $deep ? $value->toArray() : $value;
            } else {
                $array[$key] = $value;
            }
        }

        return $array;
    }