public function createField($fieldType, $name = null, $required = false)
    {
        $fieldPosition = $this->getActualFieldPosition();
        $name = ($name == null ? $fieldType : $name);
        $fieldCreateStruct = $this->contentTypeService->newFieldDefinitionCreateStruct(
            $name,
            $this->fieldTypeInternalIdentifier[$fieldType]
        );
        $fieldCreateStruct->names = array(self::DEFAULT_LANGUAGE => $name);
        $fieldCreateStruct->position = $fieldPosition;
        $fieldCreateStruct->isRequired = $required;
        $fieldCreateStruct->defaultValue = $this->defaultValues[$fieldType];
        $this->fieldConstructionObject['fieldType'] = $fieldCreateStruct;
        $this->fieldConstructionObject['objectState'] = self::FIELD_TYPE_CREATED;
    }
public function createField($fieldType, $name = null, $required = false)
    {
        $fieldPosition = $this->getActualFieldPosition();
        $name = ($name == null ? $fieldType : $name);
        $fieldCreateStruct = $this->contentTypeService->newFieldDefinitionCreateStruct(
            $name,
            $this->fieldTypeInternalIdentifier[$fieldType]
        );
        $fieldCreateStruct->names = array(self::DEFAULT_LANGUAGE => $name);
        $fieldCreateStruct->position = $fieldPosition;
        $fieldCreateStruct->isRequired = $required;
        $fieldCreateStruct->defaultValue = $this->defaultValues[$fieldType];
        $this->fieldConstructionObject['fieldType'] = $fieldCreateStruct;
        $this->fieldConstructionObject['objectState'] = self::FIELD_TYPE_CREATED;
    }
public function createField ( $ fieldType , $ name = null , $ required = false ) { $ fieldPosition = $ this -> getActualFieldPosition ( ) ; $ name = ( $ name == null ? $ fieldType : $ name ) ; $ fieldCreateStruct = $ this -> contentTypeService -> newFieldDefinitionCreateStruct ( $ name , $ this -> fieldTypeInternalIdentifier [ $ fieldType ] ) ; $ fieldCreateStruct -> names = array ( self :: DEFAULT_LANGUAGE => $ name ) ; $ fieldCreateStruct -> position = $ fieldPosition ; $ fieldCreateStruct -> isRequired = $ required ; $ fieldCreateStruct -> defaultValue = $ this -> defaultValues [ $ fieldType ] ; $ this -> fieldConstructionObject [ 'fieldType' ] = $ fieldCreateStruct ; $ this -> fieldConstructionObject [ 'objectState' ] = self :: FIELD_TYPE_CREATED ; }
Creates a fieldtype ans stores it for later use.

@param string $fieldType Type of the field
@param string $name Name of the field, optional, if not specified $fieldType is used
@param bool $required True if the is the field required, optional
Creates a fieldtype ans stores it for later use .