Private function to get the common type from the information of the field
@param string $fieldName
@param string $nativeType
@return string
500099
private function getCommonType($fieldName, $nativeType)
    {
        if (isset($this->overrideTypes[$fieldName])) {
            return $this->overrideTypes[$fieldName];
        }
        $nativeType = strtolower($nativeType);
        $type = CommonTypes::TTEXT;
        if (array_key_exists($nativeType, static::$types)) {
            $type = static::$types[$nativeType];
        }
        return $type;
    }
286118
protected function createMapField($fieldName, $fieldType)
    {
        $field = new ProtoBuf\MapField();

        $field->setName($fieldName);
        $field->setType($fieldType);

        return $field;
    }
81293
@Nullable
  public SoyType getType(String typeName) {
    SoyType result = BUILTIN_TYPES.get(typeName);
    if (result != null) {
      return result;
    }
    synchronized (lock) {
      result = protoTypeCache.get(typeName);
      if (result == null) {
        GenericDescriptor descriptor = descriptors.get(typeName);
        if (descriptor == null) {
          return null;
        }
        if (descriptor instanceof EnumDescriptor) {
          result = new SoyProtoEnumType((EnumDescriptor) descriptor);
        } else {
          result = new SoyProtoType(this, (Descriptor) descriptor, extensions.get(typeName));
        }
        protoTypeCache.put(typeName, result);
      }
    }
    return result;
  }
365727
@SuppressWarnings("unchecked")
    private String getEsType(ESMapping mapping, String fieldName) {
        String key = mapping.get_index() + "-" + mapping.get_type();
        Map<String, String> fieldType = esFieldTypes.get(key);
        if (fieldType == null) {
            ImmutableOpenMap<String, MappingMetaData> mappings;
            try {
                mappings = transportClient.admin()
                    .cluster()
                    .prepareState()
                    .execute()
                    .actionGet()
                    .getState()
                    .getMetaData()
                    .getIndices()
                    .get(mapping.get_index())
                    .getMappings();
            } catch (NullPointerException e) {
                throw new IllegalArgumentException("Not found the mapping info of index: " + mapping.get_index());
            }
            MappingMetaData mappingMetaData = mappings.get(mapping.get_type());
            if (mappingMetaData == null) {
                throw new IllegalArgumentException("Not found the mapping info of index: " + mapping.get_index());
            }

            fieldType = new LinkedHashMap<>();

            Map<String, Object> sourceMap = mappingMetaData.getSourceAsMap();
            Map<String, Object> esMapping = (Map<String, Object>) sourceMap.get("properties");
            for (Map.Entry<String, Object> entry : esMapping.entrySet()) {
                Map<String, Object> value = (Map<String, Object>) entry.getValue();
                if (value.containsKey("properties")) {
                    fieldType.put(entry.getKey(), "object");
                } else {
                    fieldType.put(entry.getKey(), (String) value.get("type"));
                }
            }
            esFieldTypes.put(key, fieldType);
        }

        return fieldType.get(fieldName);
    }
1309691
public String getParameterTypeName( int param ) throws OdaException 
	{
        int nativeTypeCode = getParameterType( param );
        return Driver.getNativeDataTypeName( nativeTypeCode );
	}
640595
final public function getOriginalValue(string $fieldName, $defaultValue = '')
    {
        if (! is_array($this->originalValues) || ! array_key_exists($fieldName, $this->originalValues)) {
            return $defaultValue;
        }
        return $this->originalValues[$fieldName];
    }
1044178
function fieldtemplate($fieldtype = null) {
		$fieldtype !== null or $fieldtype = 'field';
		if ($this->fieldtemplates !== null) {
			if (isset($this->fieldtemplates[$fieldtype])) {
				return $this->fieldtemplates[$fieldtype];
			}
			else if (isset($this->fieldtemplates['field'])) {
				return $this->fieldtemplates['field'];
			}
		}

		// hard default: display field only
		return ':field';
	}
226051
protected function mapFieldTypeToBindType($native_type)
    {
        $oracleDatatypeMap = array(
            'varchar2' => 'string',
            'nvarchar2' => 'string',
            'number' => 'number',
            'long' => 'number',
            'date' => 'datetime',
            'binary_float' => 'number',
            'binary_double' => 'number',
            'timestamp' => 'datetime',
            'interval year' => 'datetime',
            'interval day' => 'datetime',
            'raw' => 'string',
            'long raw' => 'string',
            'rowid' => 'string',
            'urowid' => 'string',
            'char' => 'string',
            'nchar' => 'string',
            'clob' => 'string',
            'nclob' => 'string',
            'blob' => 'string',
            'bfile' => 'string',
        );
        
        $native_type = strtolower($native_type);
        if (isset($oracleDatatypeMap[$native_type])) {
            return $oracleDatatypeMap[$native_type];
        } else {
            return "unknown";
        }
    }
1123269
public function hasFieldOfType($fieldType)
    {
        foreach ($this->fields as $field) {
            if ($field['type'] == $fieldType) {
                return true;
            }
        }

        return false;
    }
406484
function columnType($fieldname, $source)
    {
        $column = self::describeColumn($fieldname, $source);
        if ( ! $column ) throw new \Exception("Could not find $fieldname");
        $type = U::get($column, "Type");
        if ( ! $type ) return null;
        if ( strpos($type, '(') === false ) return $type;
        $matches = array();
        preg_match('/([a-z]+)\([0-9]+\)/', $type, $matches);
        if ( count($matches) == 2 ) return $matches[1];
        return null;
    }
783564
final private static function getColumnType($fieldName) {
		
		$db = Database::getInstance();
		$column = $db->describeColumn(static::TABLE_NAME, $fieldName);
		
		if (is_null($column)) {
			return NULL;
		}
		
		// split the column Type to recognize field type and length
		preg_match('#^([\w]+)(\([^\)]+\))? ?(unsigned)?#i', $column->Type, $matches);
		
		$field = new \stdClass();
		
		$field->name	= $fieldName;
		$field->type	= $matches[1];
		$field->unsigned= (isset($matches[3]));
		$field->nullable= 'YES' == $column->Null ? TRUE : FALSE;
		$field->key		= $column->Key;
		$field->default	= $column->Default;
		$field->extra	= $column->Extra;

		if (isset($matches[2])) {
			if (in_array($field->type, ['enum','set'])) {
				$field->length = explode("','", substr($matches[2], 2, -2));
			} else {
				$field->length = explode(",", substr($matches[2], 1, -1));
			}
		} else {
			$field->length = NULL;
		}
		
		return $field;
		
	}
1350883
public function getFieldType($field)
    {
        return isset($this->getFieldsConfig()[$field]) ? $this->getFieldsConfig()[$field]['type'] : null;
    }
367817
protected function getAsNativeType()
    {
        if ($this->isZero()) {
            return 0;
        }
        if ($this->isReal()) {
            return $this->value['real']->get();
        }
        //return as string
        return (string) $this;
    }
269775
public function & GetFirstFieldByType ($fieldType = '') {
		$result = NULL;
		foreach ($this->fields as & $field) {
			if ($field->GetType() == $fieldType) {
				$result = & $field;
			}
		}
		return $result;
	}
571200
public function getLocalizedFieldName($fieldName)
    {
        if ($this->isLocalizedField($fieldName) || $this->isLocalizedRelation($fieldName)) {
            return self::localized_field($fieldName);
        }
        trigger_error("Field '$fieldName' is not a localized field", E_USER_ERROR);
    }
8277
private function getFieldType($fieldName, $documentDefinition)
    {
        foreach ($documentDefinition->fields as $fieldTypeDefinition) {
            if ($fieldTypeDefinition->slug === $fieldName) {
                return $fieldTypeDefinition->type;
            }
        }

        throw new \Exception('Unknown field type for field' . $fieldName . ' in document ' . $this->document->path);
    }
884861
private JSType getJSType(Node n) {
    JSType type = n.getJSType();
    if (type == null) {
      // TODO(bradfordcsmith): This branch indicates a compiler bug. It should throw an exception.
      return compiler.getTypeRegistry().getNativeType(JSTypeNative.UNKNOWN_TYPE);
    } else {
      return type;
    }
  }