public function loadContentTypeFieldDefinition($contentTypeId, $fieldDefinitionId, Request $request)
    {
        $contentType = $this->contentTypeService->loadContentType($contentTypeId, Language::ALL);

        foreach ($contentType->getFieldDefinitions() as $fieldDefinition) {
            if ($fieldDefinition->id == $fieldDefinitionId) {
                return new Values\RestFieldDefinition(
                    $contentType,
                    $fieldDefinition
                );
            }
        }

        throw new Exceptions\NotFoundException("Field definition not found: '{$request->getPathInfo()}'.");
    }
public function loadContentTypeFieldDefinition($contentTypeId, $fieldDefinitionId, Request $request)
    {
        $contentType = $this->contentTypeService->loadContentType($contentTypeId, Language::ALL);

        foreach ($contentType->getFieldDefinitions() as $fieldDefinition) {
            if ($fieldDefinition->id == $fieldDefinitionId) {
                return new Values\RestFieldDefinition(
                    $contentType,
                    $fieldDefinition
                );
            }
        }

        throw new Exceptions\NotFoundException("Field definition not found: '{$request->getPathInfo()}'.");
    }
public function loadContentTypeFieldDefinition ( $ contentTypeId , $ fieldDefinitionId , Request $ request ) { $ contentType = $ this -> contentTypeService -> loadContentType ( $ contentTypeId , Language :: ALL ) ; foreach ( $ contentType -> getFieldDefinitions ( ) as $ fieldDefinition ) { if ( $ fieldDefinition -> id == $ fieldDefinitionId ) { return new Values \ RestFieldDefinition ( $ contentType , $ fieldDefinition ) ; } } throw new Exceptions \ NotFoundException ( "Field definition not found: '{$request->getPathInfo()}'." ) ; }
Returns the 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 field definition given by id .