コード例 #1
0
ファイル: ResultSet.php プロジェクト: sad-spirit/pg-wrapper
 /**
  * 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;
 }
コード例 #2
0
ファイル: Connection.php プロジェクト: sad-spirit/pg-wrapper
 /**
  * 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;
 }