bundle/Core/Persistence/ContentTypeUtils.php
public function getFieldId($contentId, $fieldDefIdentifier)
    {
        $content = $this->contentService->loadContent($contentId);

        $contentType = $this->contentTypeService
            ->loadContentType($content->contentInfo->contentTypeId);

        $field = $contentType->getFieldDefinition($fieldDefIdentifier);

        if (!$field instanceof FieldDefinition) {
            throw new OutOfBoundsException(sprintf("ContentType does not contain field with identifier %s.", $fieldDefIdentifier));
        }

        return $field->id;
    }
public function getFieldId($contentId, $fieldDefIdentifier)
    {
        $content = $this->contentService->loadContent($contentId);

        $contentType = $this->contentTypeService
            ->loadContentType($content->contentInfo->contentTypeId);

        $field = $contentType->getFieldDefinition($fieldDefIdentifier);

        if (!$field instanceof FieldDefinition) {
            throw new OutOfBoundsException(sprintf("ContentType does not contain field with identifier %s.", $fieldDefIdentifier));
        }

        return $field->id;
    }
public function getFieldId ( $ contentId , $ fieldDefIdentifier ) { $ content = $ this -> contentService -> loadContent ( $ contentId ) ; $ contentType = $ this -> contentTypeService -> loadContentType ( $ content -> contentInfo -> contentTypeId ) ; $ field = $ contentType -> getFieldDefinition ( $ fieldDefIdentifier ) ; if ( ! $ field instanceof FieldDefinition ) { throw new OutOfBoundsException ( sprintf ( "ContentType does not contain field with identifier %s." , $ fieldDefIdentifier ) ) ; } return $ field -> id ; }
Return field id for fiven field definition identifier

@param int $contentId
@param string $fieldDefIdentifier

@return mixed

@throws \OutOfBoundsException
@throws \eZ\Publish\API\Repository\Exceptions\NotFoundException
@throws \eZ\Publish\API\Repository\Exceptions\UnauthorizedException
Return field id for fiven field definition identifier