public function removeContentTypeDraftFieldDefinition($contentTypeId, $fieldDefinitionId, Request $request)
    {
        $contentTypeDraft = $this->contentTypeService->loadContentTypeDraft($contentTypeId);

        $fieldDefinition = null;
        foreach ($contentTypeDraft->getFieldDefinitions() as $fieldDef) {
            if ($fieldDef->id == $fieldDefinitionId) {
                $fieldDefinition = $fieldDef;
            }
        }

        if ($fieldDefinition === null) {
            throw new Exceptions\NotFoundException("Field definition not found: '{$request->getPathInfo()}'.");
        }

        $this->contentTypeService->removeFieldDefinition(
            $contentTypeDraft,
            $fieldDefinition
        );

        return new Values\NoContent();
    }
public function removeContentTypeDraftFieldDefinition($contentTypeId, $fieldDefinitionId, Request $request)
    {
        $contentTypeDraft = $this->contentTypeService->loadContentTypeDraft($contentTypeId);

        $fieldDefinition = null;
        foreach ($contentTypeDraft->getFieldDefinitions() as $fieldDef) {
            if ($fieldDef->id == $fieldDefinitionId) {
                $fieldDefinition = $fieldDef;
            }
        }

        if ($fieldDefinition === null) {
            throw new Exceptions\NotFoundException("Field definition not found: '{$request->getPathInfo()}'.");
        }

        $this->contentTypeService->removeFieldDefinition(
            $contentTypeDraft,
            $fieldDefinition
        );

        return new Values\NoContent();
    }
public function removeContentTypeDraftFieldDefinition ( $ contentTypeId , $ fieldDefinitionId , Request $ request ) { $ contentTypeDraft = $ this -> contentTypeService -> loadContentTypeDraft ( $ contentTypeId ) ; $ fieldDefinition = null ; foreach ( $ contentTypeDraft -> getFieldDefinitions ( ) as $ fieldDef ) { if ( $ fieldDef -> id == $ fieldDefinitionId ) { $ fieldDefinition = $ fieldDef ; } } if ( $ fieldDefinition === null ) { throw new Exceptions \ NotFoundException ( "Field definition not found: '{$request->getPathInfo()}'." ) ; } $ this -> contentTypeService -> removeFieldDefinition ( $ contentTypeDraft , $ fieldDefinition ) ; return new Values \ NoContent ( ) ; }
Deletes a field definition from a content type draft.

@param $contentTypeId
@param $fieldDefinitionId

@throws \eZ\Publish\Core\REST\Common\Exceptions\NotFoundException

@return \eZ\Publish\Core\REST\Server\Values\NoContent
Deletes a field definition from a content type draft .