protected function parseToArray($object): array
    {
        if (!is_array($object)) {
            $attributes = method_exists($object, 'getAttributes')
                ? $object->getAttributes()
                : get_object_vars($object);

            return $attributes;
        }

        return $object;
    }
protected function parseToArray($object): array
    {
        if (!is_array($object)) {
            $attributes = method_exists($object, 'getAttributes')
                ? $object->getAttributes()
                : get_object_vars($object);

            return $attributes;
        }

        return $object;
    }
protected function parseToArray ( $ object ) : array { if ( ! is_array ( $ object ) ) { $ attributes = method_exists ( $ object , 'getAttributes' ) ? $ object -> getAttributes ( ) : get_object_vars ( $ object ) ; return $ attributes ; } return $ object ; }
Parses an object to an array before sending it to the SchemaMapper.

@param mixed $object the object that will be transformed into an array

@return array
Parses an object to an array before sending it to the SchemaMapper .