autoloads/opengraphoperator.php
function processObject( $contentObject, $returnArray )
    {
        if ( $this->ogIni->hasVariable( $contentObject->contentClassIdentifier(), 'LiteralMap' ) )
        {
            $literalValues = $this->ogIni->variable( $contentObject->contentClassIdentifier(), 'LiteralMap' );
            if ( $this->debug )
            {
                eZDebug::writeDebug( $literalValues, 'LiteralMap' );
            }

            if ( $literalValues )
            {
                foreach ( $literalValues as $key => $value )
                {
                    if ( !empty( $value ) )
                    {
                        $returnArray[$key] = $value;
                    }
                }
            }
        }

        if ( $this->ogIni->hasVariable( $contentObject->contentClassIdentifier(), 'AttributeMap' ) )
        {
            $attributeValues = $this->ogIni->variableArray( $contentObject->contentClassIdentifier(), 'AttributeMap' );
            if ( $this->debug )
            {
                eZDebug::writeDebug( $attributeValues, 'AttributeMap' );
            }

            if ( $attributeValues )
            {
                foreach ( $attributeValues as $key => $value )
                {
                    $contentObjectAttributeArray = $contentObject->fetchAttributesByIdentifier( array( $value[0] ) );
                    if ( !is_array( $contentObjectAttributeArray ) )
                    {
                        continue;
                    }

                    $contentObjectAttributeArray = array_values( $contentObjectAttributeArray );
                    $contentObjectAttribute = $contentObjectAttributeArray[0];

                    if ( $contentObjectAttribute instanceof eZContentObjectAttribute )
                    {
                        $openGraphHandler = ngOpenGraphBase::getInstance( $contentObjectAttribute );

                        if ( count( $value ) == 1 )
                        {
                            $data = $openGraphHandler->getData();
                        }
                        else if ( count( $value ) == 2 )
                        {
                            $data = $openGraphHandler->getDataMember( $value[1] );
                        }
                        else
                        {
                            $data = "";
                        }

                        if ( !empty( $data ) )
                        {
                            $returnArray[$key] = $data;
                        }
                    }
                }
            }
        }

        return $returnArray;
    }
function processObject( $contentObject, $returnArray )
    {
        if ( $this->ogIni->hasVariable( $contentObject->contentClassIdentifier(), 'LiteralMap' ) )
        {
            $literalValues = $this->ogIni->variable( $contentObject->contentClassIdentifier(), 'LiteralMap' );
            if ( $this->debug )
            {
                eZDebug::writeDebug( $literalValues, 'LiteralMap' );
            }

            if ( $literalValues )
            {
                foreach ( $literalValues as $key => $value )
                {
                    if ( !empty( $value ) )
                    {
                        $returnArray[$key] = $value;
                    }
                }
            }
        }

        if ( $this->ogIni->hasVariable( $contentObject->contentClassIdentifier(), 'AttributeMap' ) )
        {
            $attributeValues = $this->ogIni->variableArray( $contentObject->contentClassIdentifier(), 'AttributeMap' );
            if ( $this->debug )
            {
                eZDebug::writeDebug( $attributeValues, 'AttributeMap' );
            }

            if ( $attributeValues )
            {
                foreach ( $attributeValues as $key => $value )
                {
                    $contentObjectAttributeArray = $contentObject->fetchAttributesByIdentifier( array( $value[0] ) );
                    if ( !is_array( $contentObjectAttributeArray ) )
                    {
                        continue;
                    }

                    $contentObjectAttributeArray = array_values( $contentObjectAttributeArray );
                    $contentObjectAttribute = $contentObjectAttributeArray[0];

                    if ( $contentObjectAttribute instanceof eZContentObjectAttribute )
                    {
                        $openGraphHandler = ngOpenGraphBase::getInstance( $contentObjectAttribute );

                        if ( count( $value ) == 1 )
                        {
                            $data = $openGraphHandler->getData();
                        }
                        else if ( count( $value ) == 2 )
                        {
                            $data = $openGraphHandler->getDataMember( $value[1] );
                        }
                        else
                        {
                            $data = "";
                        }

                        if ( !empty( $data ) )
                        {
                            $returnArray[$key] = $data;
                        }
                    }
                }
            }
        }

        return $returnArray;
    }
function processObject ( $ contentObject , $ returnArray ) { if ( $ this -> ogIni -> hasVariable ( $ contentObject -> contentClassIdentifier ( ) , 'LiteralMap' ) ) { $ literalValues = $ this -> ogIni -> variable ( $ contentObject -> contentClassIdentifier ( ) , 'LiteralMap' ) ; if ( $ this -> debug ) { eZDebug :: writeDebug ( $ literalValues , 'LiteralMap' ) ; } if ( $ literalValues ) { foreach ( $ literalValues as $ key => $ value ) { if ( ! empty ( $ value ) ) { $ returnArray [ $ key ] = $ value ; } } } } if ( $ this -> ogIni -> hasVariable ( $ contentObject -> contentClassIdentifier ( ) , 'AttributeMap' ) ) { $ attributeValues = $ this -> ogIni -> variableArray ( $ contentObject -> contentClassIdentifier ( ) , 'AttributeMap' ) ; if ( $ this -> debug ) { eZDebug :: writeDebug ( $ attributeValues , 'AttributeMap' ) ; } if ( $ attributeValues ) { foreach ( $ attributeValues as $ key => $ value ) { $ contentObjectAttributeArray = $ contentObject -> fetchAttributesByIdentifier ( array ( $ value [ 0 ] ) ) ; if ( ! is_array ( $ contentObjectAttributeArray ) ) { continue ; } $ contentObjectAttributeArray = array_values ( $ contentObjectAttributeArray ) ; $ contentObjectAttribute = $ contentObjectAttributeArray [ 0 ] ; if ( $ contentObjectAttribute instanceof eZContentObjectAttribute ) { $ openGraphHandler = ngOpenGraphBase :: getInstance ( $ contentObjectAttribute ) ; if ( count ( $ value ) == 1 ) { $ data = $ openGraphHandler -> getData ( ) ; } else if ( count ( $ value ) == 2 ) { $ data = $ openGraphHandler -> getDataMember ( $ value [ 1 ] ) ; } else { $ data = "" ; } if ( ! empty ( $ data ) ) { $ returnArray [ $ key ] = $ data ; } } } } } return $ returnArray ; }
Processes Open Graph metadata from object attributes

@param eZContentObject $contentObject
@param array $returnArray

@return array
Processes Open Graph metadata from object attributes