public function mapObjectToArray($object, string $prefix = "")
    {
        if (!is_object($object)) {
            return $object;
        }
        if (get_class($object) === \stdClass::class) {
            return (array)$object;
        }

        $objectClass = new \ReflectionClass($object);

        $objectProperties = $this->getObjectProperties($objectClass);

        $array = array();
        foreach ($objectProperties as $property) {
            if ($property->getGetter() == null && !$property->isPublic()) {
                continue;
            }

            $value = $this->getValue($object, $property);
            if ($value === null) {
                continue;
            }

            $propertyName = $property->getName();
            $annotations = $property->getAnnotations();

            $propertyKey = empty($prefix) ? $propertyName : $prefix . self::PATH_DELIMITER . $propertyName;

            if (is_array($value)
                && array_key_exists(TypeValidator::ANNOTATION, $annotations)
                && TypeHelper::isTypedArrayType($annotations[TypeValidator::ANNOTATION])
            ) {
                $items = array();
                foreach ($value as $index => $item) {
                    $items[] = $this->mapObjectToArray($item);
                }
                $array[$propertyKey] = $items;
            } else {
                $array[$propertyKey] = $this->mapObjectToArray($value);
            }
        }

        return $array;
    }