protected function getFieldDefinition(array $data)
    {
        $contentTypeId = $this->requestParser->parseHref($data['__url'], 'contentTypeId');
        $fieldDefinitionId = $this->requestParser->parseHref($data['__url'], 'fieldDefinitionId');

        $contentTypeDraft = $this->contentTypeService->loadContentTypeDraft($contentTypeId);
        foreach ($contentTypeDraft->getFieldDefinitions() as $fieldDefinition) {
            if ($fieldDefinition->id == $fieldDefinitionId) {
                return $fieldDefinition;
            }
        }
        throw new Exceptions\NotFoundException("Field definition not found: '{$data['__url']}'.");
    }
protected function getFieldDefinition(array $data)
    {
        $contentTypeId = $this->requestParser->parseHref($data['__url'], 'contentTypeId');
        $fieldDefinitionId = $this->requestParser->parseHref($data['__url'], 'fieldDefinitionId');

        $contentTypeDraft = $this->contentTypeService->loadContentTypeDraft($contentTypeId);
        foreach ($contentTypeDraft->getFieldDefinitions() as $fieldDefinition) {
            if ($fieldDefinition->id == $fieldDefinitionId) {
                return $fieldDefinition;
            }
        }
        throw new Exceptions\NotFoundException("Field definition not found: '{$data['__url']}'.");
    }
protected function getFieldDefinition ( array $ data ) { $ contentTypeId = $ this -> requestParser -> parseHref ( $ data [ '__url' ] , 'contentTypeId' ) ; $ fieldDefinitionId = $ this -> requestParser -> parseHref ( $ data [ '__url' ] , 'fieldDefinitionId' ) ; $ contentTypeDraft = $ this -> contentTypeService -> loadContentTypeDraft ( $ contentTypeId ) ; foreach ( $ contentTypeDraft -> getFieldDefinitions ( ) as $ fieldDefinition ) { if ( $ fieldDefinition -> id == $ fieldDefinitionId ) { return $ fieldDefinition ; } } throw new Exceptions \ NotFoundException ( "Field definition not found: '{$data['__url']}'." ) ; }
Returns field definition by 'typeFieldDefinitionDraft' pattern URL.

Assumes given $data array has '__url' element set.

@todo depends on temporary solution to give parser access to the URL

@see \eZ\Publish\Core\REST\Server\Controller\ContentType::updateFieldDefinition

@throws \eZ\Publish\API\Repository\Exceptions\NotFoundException

@param array $data

@return \eZ\Publish\API\Repository\Values\ContentType\FieldDefinition
Returns field definition by typeFieldDefinitionDraft pattern URL .