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(); }