Method that is called when field is added to a type.

@param TypeInterface $type
421774
public function onAddedToType(TypeInterface &$type)
    {
        parent::onAddedToType($type);

        if ($this->getAddIndex()) {
            $type->addIndex(new Index($this->name));
        }

        $type->addTrait(UpdatedAtInterface::class, UpdatedAtInterfaceImplementation::class)->serialize($this->name);
    }
47876
protected function update($type, $field, $value)
    {
        $this->update[$field] = [$type, $value];

        return $this;
    }
1113946
private function validateFieldCompatibility(FieldDefinition $interface, FieldDefinition $object): void
    {
        $this->getValidator(Inheritance::class)->validate($object, $interface);

        $this->validateArgumentExistence($interface, $object);
    }
1198204
private function initField(AttributeInterface $attribute)
    {
        $fieldName = $attribute->getAttributeCode();
        $fieldConfig = $this->attributeHelper->getMappingFieldOptions($attribute);

        if ($attribute->usesSource()) {
            $optionFieldName = $this->attributeHelper->getOptionTextFieldName($fieldName);
            $fieldType = FieldInterface::FIELD_TYPE_TEXT;
            $fieldOptions = ['name' => $optionFieldName, 'type' => $fieldType, 'fieldConfig' => $fieldConfig];
            $this->fields[$optionFieldName] = $this->fieldFactory->create($fieldOptions);

            // Reset parent field values : only the option text field should be used for spellcheck and autocomplete.
            $fieldConfig['is_used_in_spellcheck'] = false;
            $fieldConfig['is_searchable'] = false;
        }

        $fieldType    = $this->attributeHelper->getFieldType($attribute);
        $fieldOptions = ['name' => $fieldName, 'type' => $fieldType, 'fieldConfig' => $fieldConfig];

        $this->fields[$fieldName] = $this->fieldFactory->create($fieldOptions);

        return $this;
    }
1210091
public function setType($parameterIndex, ObjectTypeInterface $type)
    {
        $this->setParameter($parameterIndex, $this->escape($type->getQueryName()));
    }
454965
public function add($type)
    {
        $this->value[] = $type;
        $this->value = array_unique($this->value);
    }
495298
public function processItems(EntityInterface $entity, $type = 'input') {
		$fields = $this->_config['fields'];

		foreach ($fields as $field => $map) {
			if (is_numeric($field)) {
				$field = $map;
				$map = [];
			} else {
				$map = (array)$map;
			}

			$val = $entity->get($field);
			if (!$val && !is_numeric($val)) {
				continue;
			}

			if (!$map) {
				$map = $this->_config[$type];
			}
			if (!$map) {
				continue;
			}

			$entity->set($field, $this->_process($val, $map));
		}
	}
915233
public function removeType(string $type)
    {
        if (!$this->removing && Type::hasType($type)) {
            $this->removing = true;
            Type::overrideType($type, null);
        }

        $this->removing = false;
        unset($this->types[$type]);
    }
1292549
public function setType( $type )
	{
		if ( $type == $this->getType() ) { return; }

		$this->_checkType( $type );

		$this->_values['type'] = (string) $type;
		$this->setModified();
	}
827880
public function setType(string $type) : void
    {
        if (empty($type)) {
            throw new InvalidArgumentException('Empty field type is not allowed: ' . $this->getName());
        }

        $this->_type = $this->_extractType($type);
    }
992169
public function field($type, $fieldName, $length=NULL)
    {
        if($length === null){
             $this->fieldDescription[] = $type ." ".$fieldName;
        }else
        {
         $this->fieldDescription[] = $type ." ".$fieldName." ".$length;
        }

    }
366119
public static function findAllFields(TypeInfoInterface $type, TypeInfoManagerInterface $manager)
	{
		$fields = [];
		$types = array_filter(array_merge($type->getSupertypes($manager, true), [$type]), function(TypeInfoInterface $type) {
			return !$type->isInterface();
		});
		
		foreach($types as $source)
		{
			foreach($source->getFields() as $field)
			{
				if(!$field->isPrivate() || $field->getDeclaringType()->getKey() === $type->getKey())
				{
					$fields[$field->getName()] = $field;
				}
			}
		}
		
		return $fields;
	}
1370761
private <X> void onDeclaredFields(Class<X> clazz, AbstractManagedType<X> managedType)
    {
        Field[] embeddedFields = clazz.getDeclaredFields();
        for (Field f : embeddedFields)
        {
            if (isNonTransient(f))
            {
                new TypeBuilder<T>(f).build(managedType, f.getType());
            }
        }
    }
896688
public static function addType($type, $class)
    {
        if (static::hasType($type)) {
            throw TypeException::typeAlreadyExists($type);
        }

        if (!class_exists($class)) {
            throw TypeException::classNotFound($class);
        }

        if (!in_array('Fridge\DBAL\Type\TypeInterface', class_implements($class))) {
            throw TypeException::typeMustImplementTypeInterface($class);
        }

        static::$mappedTypeClasses[$type] = $class;
    }
1036416
public function setFieldType($field, Type $type) {
    $this->types->set($this->getKey($field), $type);
    return $this;
  }
1362616
private static void collectFields(Class<?> type, List<Field> fields) {
        final Field[] declaredFields = type.getDeclaredFields();
        for (Field declaredField : declaredFields) {
            if (isPersistable(declaredField)) {
                fields.add(declaredField);
            }
        }
        if (type.getSuperclass() != null) {
            collectFields(type.getSuperclass(), fields);
        }
    }
604430
private function completeFieldType(Input $field, ReflectionMethod $method, ReflectionParameter $param, DocBlockReader $docBlock): void
    {
        // If still no type, look for docBlock
        if (!$field->getTypeInstance()) {
            $typeDeclaration = $docBlock->getParameterType($param);
            $this->throwIfArray($param, $typeDeclaration);
            $field->setTypeInstance($this->getTypeFromPhpDeclaration($method, $typeDeclaration, true));
        }

        // If still no type, look for type hint
        $type = $param->getType();
        if (!$field->getTypeInstance() && $type) {
            $this->throwIfArray($param, (string) $type);
            $field->setTypeInstance($this->reflectionTypeToType($type, true));
        }

        $this->nonNullIfHasDefault($field);

        // If still no type, cannot continue
        $this->throwIfNotInputType($param, $field);
    }