/** * 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 Type or an * argument to TypeFactory::getConverter() * @return $this * @throws exceptions\InvalidArgumentException */ public function setType($fieldIndex, $type) { $this->_checkFieldIndex($fieldIndex); if (is_string($fieldIndex)) { $fieldIndex = $this->_namesHash[$fieldIndex]; } if (!$type instanceof TypeConverter) { $type = $this->_converterFactory->getConverter($type); } $this->_converters[$fieldIndex] = $type; return $this; }
/** * Sets the factory object for converters to and from PostgreSQL types * * @param TypeConverterFactory $factory * @return $this */ public function setTypeConverterFactory(TypeConverterFactory $factory) { $this->_converterFactory = $factory; $factory->setConnection($this); return $this; }