protected function _toArray($data)
    {
        $array = array();

        foreach ($data as $key => $value) {
            if (is($value, 'AnDomainBehaviorSerializable')) {
                $array[$key] = $value->toSerializableArray();
            } elseif (is_array($value)) {
                $array[$key] = $this->_toArray($value);
            } else {
                $array[$key] = $value;
            }
        }

        return $array;
    }