src/ServiceBus/Models/TopicDescription.php
public static function create($topicDescriptionXml)
    {
        $topicDescription = new self();
        $root = simplexml_load_string($topicDescriptionXml);
        $topicDescriptionArray = (array) $root;

        if (array_key_exists('DefaultMessageToLive', $topicDescriptionArray)) {
            $topicDescription->setDefaultMessageTimeToLive(
                (string) $topicDescriptionArray['DefaultMessageToLive']
            );
        }

        if (array_key_exists('MaxSizeInMegabytes', $topicDescriptionArray)) {
            $topicDescription->setMaxSizeInMegabytes(
                (int) $topicDescriptionArray['MaxSizeInMegabytes']
            );
        }

        if (array_key_exists(
            'RequiresDuplicateDetection',
            $topicDescriptionArray
        )
        ) {
            $topicDescription->setRequiresDuplicateDetection(
                (bool) $topicDescriptionArray['RequiresDuplicateDetection']
            );
        }

        if (array_key_exists(
            'DuplicateDetectionHistoryTimeWindow',
            $topicDescriptionArray
        )
        ) {
            $topicDescription->setDuplicateDetectionHistoryTimeWindow(
                (string) $topicDescriptionArray['DuplicateDetectionHistoryTimeWindow']
            );
        }

        if (array_key_exists(
            'EnableBatchedOperations',
            $topicDescriptionArray
        )) {
            $topicDescription->setEnableBatchedOperations(
                (bool) $topicDescriptionArray['EnableBatchedOperations']
            );
        }

        return $topicDescription;
    }
public static function create($topicDescriptionXml)
    {
        $topicDescription = new self();
        $root = simplexml_load_string($topicDescriptionXml);
        $topicDescriptionArray = (array) $root;

        if (array_key_exists('DefaultMessageToLive', $topicDescriptionArray)) {
            $topicDescription->setDefaultMessageTimeToLive(
                (string) $topicDescriptionArray['DefaultMessageToLive']
            );
        }

        if (array_key_exists('MaxSizeInMegabytes', $topicDescriptionArray)) {
            $topicDescription->setMaxSizeInMegabytes(
                (int) $topicDescriptionArray['MaxSizeInMegabytes']
            );
        }

        if (array_key_exists(
            'RequiresDuplicateDetection',
            $topicDescriptionArray
        )
        ) {
            $topicDescription->setRequiresDuplicateDetection(
                (bool) $topicDescriptionArray['RequiresDuplicateDetection']
            );
        }

        if (array_key_exists(
            'DuplicateDetectionHistoryTimeWindow',
            $topicDescriptionArray
        )
        ) {
            $topicDescription->setDuplicateDetectionHistoryTimeWindow(
                (string) $topicDescriptionArray['DuplicateDetectionHistoryTimeWindow']
            );
        }

        if (array_key_exists(
            'EnableBatchedOperations',
            $topicDescriptionArray
        )) {
            $topicDescription->setEnableBatchedOperations(
                (bool) $topicDescriptionArray['EnableBatchedOperations']
            );
        }

        return $topicDescription;
    }
public static function create ( $ topicDescriptionXml ) { $ topicDescription = new self ( ) ; $ root = simplexml_load_string ( $ topicDescriptionXml ) ; $ topicDescriptionArray = ( array ) $ root ; if ( array_key_exists ( 'DefaultMessageToLive' , $ topicDescriptionArray ) ) { $ topicDescription -> setDefaultMessageTimeToLive ( ( string ) $ topicDescriptionArray [ 'DefaultMessageToLive' ] ) ; } if ( array_key_exists ( 'MaxSizeInMegabytes' , $ topicDescriptionArray ) ) { $ topicDescription -> setMaxSizeInMegabytes ( ( int ) $ topicDescriptionArray [ 'MaxSizeInMegabytes' ] ) ; } if ( array_key_exists ( 'RequiresDuplicateDetection' , $ topicDescriptionArray ) ) { $ topicDescription -> setRequiresDuplicateDetection ( ( bool ) $ topicDescriptionArray [ 'RequiresDuplicateDetection' ] ) ; } if ( array_key_exists ( 'DuplicateDetectionHistoryTimeWindow' , $ topicDescriptionArray ) ) { $ topicDescription -> setDuplicateDetectionHistoryTimeWindow ( ( string ) $ topicDescriptionArray [ 'DuplicateDetectionHistoryTimeWindow' ] ) ; } if ( array_key_exists ( 'EnableBatchedOperations' , $ topicDescriptionArray ) ) { $ topicDescription -> setEnableBatchedOperations ( ( bool ) $ topicDescriptionArray [ 'EnableBatchedOperations' ] ) ; } return $ topicDescription ; }
Creates a topic description object with specified XML string.

@param string $topicDescriptionXml A XML based string describing
the topic

@return TopicDescription
Creates a topic description object with specified XML string .