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()}'.");
    }
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()}'.");
    }
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()}'." ) ; }
Returns the draft field definition given by id.

@param $contentTypeId
@param $fieldDefinitionId

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

@return \eZ\Publish\Core\REST\Server\Values\RestFieldDefinition
Returns the draft field definition given by id .