src/ServiceBus/Models/QueueDescription.php
public static function create($queueDescriptionXml)
    {
        $queueDescription = new self();
        $root = simplexml_load_string(
            $queueDescriptionXml
        );
        $queueDescriptionArray = (array) $root;
        if (array_key_exists('LockDuration', $queueDescriptionArray)) {
            $queueDescription->setLockDuration(
                (string) $queueDescriptionArray['LockDuration']
            );
        }

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

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

        if (array_key_exists('RequiresSession', $queueDescriptionArray)) {
            $queueDescription->setRequiresSession(
                (bool) $queueDescriptionArray['RequiresSession']
            );
        }

        if (array_key_exists(
            'DefaultMessageTimeToLive',
            $queueDescriptionArray
        )
        ) {
            $queueDescription->setDefaultMessageTimeToLive(
                (string) $queueDescriptionArray['DefaultMessageTimeToLive']
            );
        }

        if (array_key_exists(
            'DeadLetteringOnMessageExpiration',
            $queueDescriptionArray
        )
        ) {
            $queueDescription->setDeadLetteringOnMessageExpiration(
                (string) $queueDescriptionArray['DeadLetteringOnMessageExpiration']
            );
        }

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

        if (array_key_exists('MaxDeliveryCount', $queueDescriptionArray)) {
            $queueDescription->setMaxDeliveryCount(
                (int) $queueDescriptionArray['MaxDeliveryCount']
            );
        }

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

        if (array_key_exists('SizeInBytes', $queueDescriptionArray)) {
            $queueDescription->setSizeInBytes(
                (int) $queueDescriptionArray['SizeInBytes']
            );
        }

        if (array_key_exists('MessageCount', $queueDescriptionArray)) {
            $queueDescription->setMessageCount(
                (int) $queueDescriptionArray['MessageCount']
            );
        }

        return $queueDescription;
    }
public static function create($queueDescriptionXml)
    {
        $queueDescription = new self();
        $root = simplexml_load_string(
            $queueDescriptionXml
        );
        $queueDescriptionArray = (array) $root;
        if (array_key_exists('LockDuration', $queueDescriptionArray)) {
            $queueDescription->setLockDuration(
                (string) $queueDescriptionArray['LockDuration']
            );
        }

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

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

        if (array_key_exists('RequiresSession', $queueDescriptionArray)) {
            $queueDescription->setRequiresSession(
                (bool) $queueDescriptionArray['RequiresSession']
            );
        }

        if (array_key_exists(
            'DefaultMessageTimeToLive',
            $queueDescriptionArray
        )
        ) {
            $queueDescription->setDefaultMessageTimeToLive(
                (string) $queueDescriptionArray['DefaultMessageTimeToLive']
            );
        }

        if (array_key_exists(
            'DeadLetteringOnMessageExpiration',
            $queueDescriptionArray
        )
        ) {
            $queueDescription->setDeadLetteringOnMessageExpiration(
                (string) $queueDescriptionArray['DeadLetteringOnMessageExpiration']
            );
        }

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

        if (array_key_exists('MaxDeliveryCount', $queueDescriptionArray)) {
            $queueDescription->setMaxDeliveryCount(
                (int) $queueDescriptionArray['MaxDeliveryCount']
            );
        }

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

        if (array_key_exists('SizeInBytes', $queueDescriptionArray)) {
            $queueDescription->setSizeInBytes(
                (int) $queueDescriptionArray['SizeInBytes']
            );
        }

        if (array_key_exists('MessageCount', $queueDescriptionArray)) {
            $queueDescription->setMessageCount(
                (int) $queueDescriptionArray['MessageCount']
            );
        }

        return $queueDescription;
    }
public static function create ( $ queueDescriptionXml ) { $ queueDescription = new self ( ) ; $ root = simplexml_load_string ( $ queueDescriptionXml ) ; $ queueDescriptionArray = ( array ) $ root ; if ( array_key_exists ( 'LockDuration' , $ queueDescriptionArray ) ) { $ queueDescription -> setLockDuration ( ( string ) $ queueDescriptionArray [ 'LockDuration' ] ) ; } if ( array_key_exists ( 'MaxSizeInMegabytes' , $ queueDescriptionArray ) ) { $ queueDescription -> setMaxSizeInMegabytes ( ( int ) $ queueDescriptionArray [ 'MaxSizeInMegabytes' ] ) ; } if ( array_key_exists ( 'RequiresDuplicateDetection' , $ queueDescriptionArray ) ) { $ queueDescription -> setRequiresDuplicateDetection ( ( bool ) $ queueDescriptionArray [ 'RequiresDuplicateDetection' ] ) ; } if ( array_key_exists ( 'RequiresSession' , $ queueDescriptionArray ) ) { $ queueDescription -> setRequiresSession ( ( bool ) $ queueDescriptionArray [ 'RequiresSession' ] ) ; } if ( array_key_exists ( 'DefaultMessageTimeToLive' , $ queueDescriptionArray ) ) { $ queueDescription -> setDefaultMessageTimeToLive ( ( string ) $ queueDescriptionArray [ 'DefaultMessageTimeToLive' ] ) ; } if ( array_key_exists ( 'DeadLetteringOnMessageExpiration' , $ queueDescriptionArray ) ) { $ queueDescription -> setDeadLetteringOnMessageExpiration ( ( string ) $ queueDescriptionArray [ 'DeadLetteringOnMessageExpiration' ] ) ; } if ( array_key_exists ( 'DuplicateDetectionHistoryTimeWindow' , $ queueDescriptionArray ) ) { $ queueDescription -> setDuplicateDetectionHistoryTimeWindow ( ( string ) $ queueDescriptionArray [ 'DuplicateDetectionHistoryTimeWindow' ] ) ; } if ( array_key_exists ( 'MaxDeliveryCount' , $ queueDescriptionArray ) ) { $ queueDescription -> setMaxDeliveryCount ( ( int ) $ queueDescriptionArray [ 'MaxDeliveryCount' ] ) ; } if ( array_key_exists ( 'EnableBatchedOperations' , $ queueDescriptionArray ) ) { $ queueDescription -> setEnableBatchedOperations ( ( bool ) $ queueDescriptionArray [ 'EnableBatchedOperations' ] ) ; } if ( array_key_exists ( 'SizeInBytes' , $ queueDescriptionArray ) ) { $ queueDescription -> setSizeInBytes ( ( int ) $ queueDescriptionArray [ 'SizeInBytes' ] ) ; } if ( array_key_exists ( 'MessageCount' , $ queueDescriptionArray ) ) { $ queueDescription -> setMessageCount ( ( int ) $ queueDescriptionArray [ 'MessageCount' ] ) ; } return $ queueDescription ; }
Creates a queue description object with specified XML string.

@param string $queueDescriptionXml A XML based string describing
the queue

@return QueueDescription
Creates a queue description object with specified XML string .