lib/Elastica/Type/Mapping.php
public function toArray(): array
    {
        $type = $this->getType();

        if (empty($type)) {
            throw new InvalidException('Type has to be set');
        }

        return [$type->getName() => $this->_mapping];
    }
public function toArray(): array
    {
        $type = $this->getType();

        if (empty($type)) {
            throw new InvalidException('Type has to be set');
        }

        return [$type->getName() => $this->_mapping];
    }
public function toArray ( ) : array { $ type = $ this -> getType ( ) ; if ( empty ( $ type ) ) { throw new InvalidException ( 'Type has to be set' ) ; } return [ $ type -> getName ( ) => $ this -> _mapping ] ; }
Converts the mapping to an array.

@throws InvalidException

@return array Mapping as array
Converts the mapping to an array .