public function setType($fieldIndex, $type): self
    {
        $this->checkFieldIndex($fieldIndex);
        if (is_string($fieldIndex)) {
            $fieldIndex = $this->namesHash[$fieldIndex];
        }

        $this->converters[$fieldIndex] = $this->converterFactory->getConverterForTypeSpecification($type);

        return $this;
    }
public function setType($fieldIndex, $type): self
    {
        $this->checkFieldIndex($fieldIndex);
        if (is_string($fieldIndex)) {
            $fieldIndex = $this->namesHash[$fieldIndex];
        }

        $this->converters[$fieldIndex] = $this->converterFactory->getConverterForTypeSpecification($type);

        return $this;
    }
public function setType ( $ fieldIndex , $ type ) : self { $ this -> checkFieldIndex ( $ fieldIndex ) ; if ( is_string ( $ fieldIndex ) ) { $ fieldIndex = $ this -> namesHash [ $ fieldIndex ] ; } $ this -> converters [ $ fieldIndex ] = $ this -> converterFactory -> getConverterForTypeSpecification ( $ type ) ; return $ this ; }
Explicitly sets the type converter for the result field

@param int|string $fieldIndex Either field number or field name
@param mixed      $type       Either an instance of TypeConverter or an
argument for TypeConverterFactory::getConverterForTypeSpecification()
@return $this
@throws exceptions\InvalidArgumentException
Explicitly sets the type converter for the result field