Twig/NovaeZSEOExtension.php
protected function innerComputeMetas( Content $content, $fieldDefIdentifier, ContentType $contentType, &$needFallback = false )
    {
        if ( $fieldDefIdentifier instanceof Field )
        {
            $metasFieldValue    = $fieldDefIdentifier->value;
            $fieldDefIdentifier = $fieldDefIdentifier->fieldDefIdentifier;
        }
        else
        {
            $metasFieldValue = $content->getFieldValue( $fieldDefIdentifier );
        }

        if ( $metasFieldValue instanceof MetasFieldValue )
        {
            $metasConfig = $this->configResolver->getParameter( 'fieldtype_metas', 'nova_ezseo' );
            // as the configuration is the last fallback we need to loop on it.
            foreach ( $metasConfig as $metaName => $metasSettings )
            {
                if ( $metasFieldValue->nameExists( $metaName ) )
                {
                    $meta = $metasFieldValue->metas[$metaName];
                }
                else
                {
                    $meta = new Meta( $metaName );
                    $metasFieldValue->metas[$metaName] = $meta;
                }

                /** @var Meta $meta */
                if ( $meta->isEmpty() )
                {
                    $meta->setContent( $metasConfig[$meta->getName()]['default_pattern'] );
                    $fieldDefinition = $contentType->getFieldDefinition( $fieldDefIdentifier );
                    $configuration   = $fieldDefinition->getFieldSettings()['configuration'];
                    // but if we need something is the configuration we take it
                    if ( isset($configuration[$meta->getName()]) && !empty($configuration[$meta->getName()])  )
                    {
                        $meta->setContent( $configuration[$meta->getName()] );
                    }
                }
                if ( !$this->metaNameSchema->resolveMeta( $meta, $content, $contentType ) )
                {
                    $needFallback = true;
                }
            }
            return $metasFieldValue->metas;
        }
        return [];
    }
protected function innerComputeMetas( Content $content, $fieldDefIdentifier, ContentType $contentType, &$needFallback = false )
    {
        if ( $fieldDefIdentifier instanceof Field )
        {
            $metasFieldValue    = $fieldDefIdentifier->value;
            $fieldDefIdentifier = $fieldDefIdentifier->fieldDefIdentifier;
        }
        else
        {
            $metasFieldValue = $content->getFieldValue( $fieldDefIdentifier );
        }

        if ( $metasFieldValue instanceof MetasFieldValue )
        {
            $metasConfig = $this->configResolver->getParameter( 'fieldtype_metas', 'nova_ezseo' );
            // as the configuration is the last fallback we need to loop on it.
            foreach ( $metasConfig as $metaName => $metasSettings )
            {
                if ( $metasFieldValue->nameExists( $metaName ) )
                {
                    $meta = $metasFieldValue->metas[$metaName];
                }
                else
                {
                    $meta = new Meta( $metaName );
                    $metasFieldValue->metas[$metaName] = $meta;
                }

                /** @var Meta $meta */
                if ( $meta->isEmpty() )
                {
                    $meta->setContent( $metasConfig[$meta->getName()]['default_pattern'] );
                    $fieldDefinition = $contentType->getFieldDefinition( $fieldDefIdentifier );
                    $configuration   = $fieldDefinition->getFieldSettings()['configuration'];
                    // but if we need something is the configuration we take it
                    if ( isset($configuration[$meta->getName()]) && !empty($configuration[$meta->getName()])  )
                    {
                        $meta->setContent( $configuration[$meta->getName()] );
                    }
                }
                if ( !$this->metaNameSchema->resolveMeta( $meta, $content, $contentType ) )
                {
                    $needFallback = true;
                }
            }
            return $metasFieldValue->metas;
        }
        return [];
    }
protected function innerComputeMetas ( Content $ content , $ fieldDefIdentifier , ContentType $ contentType , & $ needFallback = false ) { if ( $ fieldDefIdentifier instanceof Field ) { $ metasFieldValue = $ fieldDefIdentifier -> value ; $ fieldDefIdentifier = $ fieldDefIdentifier -> fieldDefIdentifier ; } else { $ metasFieldValue = $ content -> getFieldValue ( $ fieldDefIdentifier ) ; } if ( $ metasFieldValue instanceof MetasFieldValue ) { $ metasConfig = $ this -> configResolver -> getParameter ( 'fieldtype_metas' , 'nova_ezseo' ) ; // as the configuration is the last fallback we need to loop on it. foreach ( $ metasConfig as $ metaName => $ metasSettings ) { if ( $ metasFieldValue -> nameExists ( $ metaName ) ) { $ meta = $ metasFieldValue -> metas [ $ metaName ] ; } else { $ meta = new Meta ( $ metaName ) ; $ metasFieldValue -> metas [ $ metaName ] = $ meta ; } /** @var Meta $meta */ if ( $ meta -> isEmpty ( ) ) { $ meta -> setContent ( $ metasConfig [ $ meta -> getName ( ) ] [ 'default_pattern' ] ) ; $ fieldDefinition = $ contentType -> getFieldDefinition ( $ fieldDefIdentifier ) ; $ configuration = $ fieldDefinition -> getFieldSettings ( ) [ 'configuration' ] ; // but if we need something is the configuration we take it if ( isset ( $ configuration [ $ meta -> getName ( ) ] ) && ! empty ( $ configuration [ $ meta -> getName ( ) ] ) ) { $ meta -> setContent ( $ configuration [ $ meta -> getName ( ) ] ) ; } } if ( ! $ this -> metaNameSchema -> resolveMeta ( $ meta , $ content , $ contentType ) ) { $ needFallback = true ; } } return $ metasFieldValue -> metas ; } return [ ] ; }
Compute Meta by reference

@param Content      $content
@param string|Field $fieldDefIdentifier
@param ContentType  $contentType
@param bool         $needFallback

@return Meta[]
Compute Meta by reference