eZ\Publish\Core\REST\Server\Controller\ContentType::loadContentTypeDraftFieldDefinition PHP Method

loadContentTypeDraftFieldDefinition() public method

Returns the draft field definition given by id.
public loadContentTypeDraftFieldDefinition ( $contentTypeId, $fieldDefinitionId, Request $request ) : RestFieldDefinition
$contentTypeId
$fieldDefinitionId
$request Symfony\Component\HttpFoundation\Request
return eZ\Publish\Core\REST\Server\Values\RestFieldDefinition
    public function loadContentTypeDraftFieldDefinition($contentTypeId, $fieldDefinitionId, Request $request)
    {
        $contentTypeDraft = $this->contentTypeService->loadContentTypeDraft($contentTypeId);
        foreach ($contentTypeDraft->getFieldDefinitions() as $fieldDefinition) {
            if ($fieldDefinition->id == $fieldDefinitionId) {
                return new Values\RestFieldDefinition($contentTypeDraft, $fieldDefinition);
            }
        }
        throw new Exceptions\NotFoundException("Field definition not found: '{$request->getPathInfo()}'.");
    }