src/Titon/Db/Behavior/ConverterBehavior.php
public function convert($field, $type, array $options = []) {
        if (!isset($this->_defaults[$type])) {
            throw new InvalidArgumentException(sprintf('Converter %s does not exist', $type));
        }

        $this->_converters[$field] = Hash::merge([
            'encode' => true,
            'decode' => true,
            'type' => $type,
        ], $this->_defaults[$type], $options);

        return $this;
    }
public function convert($field, $type, array $options = []) {
        if (!isset($this->_defaults[$type])) {
            throw new InvalidArgumentException(sprintf('Converter %s does not exist', $type));
        }

        $this->_converters[$field] = Hash::merge([
            'encode' => true,
            'decode' => true,
            'type' => $type,
        ], $this->_defaults[$type], $options);

        return $this;
    }
public function convert ( $ field , $ type , array $ options = [ ] ) { if ( ! isset ( $ this -> _defaults [ $ type ] ) ) { throw new InvalidArgumentException ( sprintf ( 'Converter %s does not exist' , $ type ) ) ; } $ this -> _converters [ $ field ] = Hash :: merge ( [ 'encode' => true , 'decode' => true , 'type' => $ type , ] , $ this -> _defaults [ $ type ] , $ options ) ; return $ this ; }
Define a converter for a specific field.

@param string $field
@param string $type
@param array $options
@return $this
@throws \Titon\Db\Exception\InvalidArgumentException
Define a converter for a specific field .