protected function getFieldValue($value, FieldDefinition $fieldDefinition, $contentTypeIdentifier, array $context = array())
    {
        $fieldTypeIdentifier = $fieldDefinition->fieldTypeIdentifier;

        if (is_array($value) || $this->fieldHandlerManager->managesField($fieldTypeIdentifier, $contentTypeIdentifier)) {
            // since we now allow refs to be arrays, let's attempt a 1st pass at resolving them here instead of every single fieldHandler...
            if (is_string($value) && $this->fieldHandlerManager->doPreResolveStringReferences($fieldTypeIdentifier, $contentTypeIdentifier)) {
                $value = $this->referenceResolver->resolveReference($value);
            }
            // inject info about the current content type and field into the context
            $context['contentTypeIdentifier'] = $contentTypeIdentifier;
            $context['fieldIdentifier'] = $fieldDefinition->identifier;
            return $this->fieldHandlerManager->hashToFieldValue($fieldTypeIdentifier, $contentTypeIdentifier, $value, $context);
        }

        return $this->getSingleFieldValue($value, $fieldDefinition, $contentTypeIdentifier, $context);
    }
protected function getFieldValue($value, FieldDefinition $fieldDefinition, $contentTypeIdentifier, array $context = array())
    {
        $fieldTypeIdentifier = $fieldDefinition->fieldTypeIdentifier;

        if (is_array($value) || $this->fieldHandlerManager->managesField($fieldTypeIdentifier, $contentTypeIdentifier)) {
            // since we now allow refs to be arrays, let's attempt a 1st pass at resolving them here instead of every single fieldHandler...
            if (is_string($value) && $this->fieldHandlerManager->doPreResolveStringReferences($fieldTypeIdentifier, $contentTypeIdentifier)) {
                $value = $this->referenceResolver->resolveReference($value);
            }
            // inject info about the current content type and field into the context
            $context['contentTypeIdentifier'] = $contentTypeIdentifier;
            $context['fieldIdentifier'] = $fieldDefinition->identifier;
            return $this->fieldHandlerManager->hashToFieldValue($fieldTypeIdentifier, $contentTypeIdentifier, $value, $context);
        }

        return $this->getSingleFieldValue($value, $fieldDefinition, $contentTypeIdentifier, $context);
    }
protected function getFieldValue ( $ value , FieldDefinition $ fieldDefinition , $ contentTypeIdentifier , array $ context = array ( ) ) { $ fieldTypeIdentifier = $ fieldDefinition -> fieldTypeIdentifier ; if ( is_array ( $ value ) || $ this -> fieldHandlerManager -> managesField ( $ fieldTypeIdentifier , $ contentTypeIdentifier ) ) { // since we now allow refs to be arrays, let's attempt a 1st pass at resolving them here instead of every single fieldHandler... if ( is_string ( $ value ) && $ this -> fieldHandlerManager -> doPreResolveStringReferences ( $ fieldTypeIdentifier , $ contentTypeIdentifier ) ) { $ value = $ this -> referenceResolver -> resolveReference ( $ value ) ; } // inject info about the current content type and field into the context $ context [ 'contentTypeIdentifier' ] = $ contentTypeIdentifier ; $ context [ 'fieldIdentifier' ] = $ fieldDefinition -> identifier ; return $ this -> fieldHandlerManager -> hashToFieldValue ( $ fieldTypeIdentifier , $ contentTypeIdentifier , $ value , $ context ) ; } return $ this -> getSingleFieldValue ( $ value , $ fieldDefinition , $ contentTypeIdentifier , $ context ) ; }
Create the field value from the migration definition hash

@param mixed $value
@param FieldDefinition $fieldDefinition
@param string $contentTypeIdentifier
@param array $context
@throws \InvalidArgumentException
@return mixed
Create the field value from the migration definition hash