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

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

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

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

        if (array_key_exists(
            'DeadLetteringOnFilterEvaluationException',
            $subscriptionDescriptionArray
        )
        ) {
            $subscriptionDescription->setDeadLetteringOnFilterEvaluationExceptions(
                (string) $subscriptionDescriptionArray[
                    'DeadLetteringOnFilterEvaluationException'
                ]
            );
        }

        if (array_key_exists(
            'DefaultRuleDescription',
            $subscriptionDescriptionArray
        )
        ) {
            $subscriptionDescription->setDefaultRuleDescription(
                (string) $subscriptionDescriptionArray['DefaultRuleDescription']
            );
        }

        if (array_key_exists('MessageCount', $subscriptionDescriptionArray)) {
            $subscriptionDescription->setMessageCount(
                (string) $subscriptionDescriptionArray['MessageCount']
            );
        }

        if (array_key_exists('MaxDeliveryCount', $subscriptionDescriptionArray)) {
            $subscriptionDescription->setMaxDeliveryCount(
                (string) $subscriptionDescriptionArray['MaxDeliveryCount']
            );
        }

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

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

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

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

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

        if (array_key_exists(
            'DeadLetteringOnFilterEvaluationException',
            $subscriptionDescriptionArray
        )
        ) {
            $subscriptionDescription->setDeadLetteringOnFilterEvaluationExceptions(
                (string) $subscriptionDescriptionArray[
                    'DeadLetteringOnFilterEvaluationException'
                ]
            );
        }

        if (array_key_exists(
            'DefaultRuleDescription',
            $subscriptionDescriptionArray
        )
        ) {
            $subscriptionDescription->setDefaultRuleDescription(
                (string) $subscriptionDescriptionArray['DefaultRuleDescription']
            );
        }

        if (array_key_exists('MessageCount', $subscriptionDescriptionArray)) {
            $subscriptionDescription->setMessageCount(
                (string) $subscriptionDescriptionArray['MessageCount']
            );
        }

        if (array_key_exists('MaxDeliveryCount', $subscriptionDescriptionArray)) {
            $subscriptionDescription->setMaxDeliveryCount(
                (string) $subscriptionDescriptionArray['MaxDeliveryCount']
            );
        }

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

        return $subscriptionDescription;
    }
public static function create ( $ subscriptionDescriptionXml ) { $ subscriptionDescription = new self ( ) ; $ root = simplexml_load_string ( $ subscriptionDescriptionXml ) ; $ subscriptionDescriptionArray = ( array ) $ root ; if ( array_key_exists ( 'LockDuration' , $ subscriptionDescriptionArray ) ) { $ subscriptionDescription -> setLockDuration ( ( string ) $ subscriptionDescriptionArray [ 'LockDuration' ] ) ; } if ( array_key_exists ( 'RequiresSession' , $ subscriptionDescriptionArray ) ) { $ subscriptionDescription -> setRequiresSession ( ( bool ) $ subscriptionDescriptionArray [ 'RequiresSession' ] ) ; } if ( array_key_exists ( 'DefaultMessageTimeToLive' , $ subscriptionDescriptionArray ) ) { $ subscriptionDescription -> setDefaultMessageTimeToLive ( ( string ) $ subscriptionDescriptionArray [ 'DefaultMessageTimeToLive' ] ) ; } if ( array_key_exists ( 'DeadLetteringOnMessageExpiration' , $ subscriptionDescriptionArray ) ) { $ subscriptionDescription -> setDeadLetteringOnMessageExpiration ( ( string ) $ subscriptionDescriptionArray [ 'DeadLetteringOnMessageExpiration' ] ) ; } if ( array_key_exists ( 'DeadLetteringOnFilterEvaluationException' , $ subscriptionDescriptionArray ) ) { $ subscriptionDescription -> setDeadLetteringOnFilterEvaluationExceptions ( ( string ) $ subscriptionDescriptionArray [ 'DeadLetteringOnFilterEvaluationException' ] ) ; } if ( array_key_exists ( 'DefaultRuleDescription' , $ subscriptionDescriptionArray ) ) { $ subscriptionDescription -> setDefaultRuleDescription ( ( string ) $ subscriptionDescriptionArray [ 'DefaultRuleDescription' ] ) ; } if ( array_key_exists ( 'MessageCount' , $ subscriptionDescriptionArray ) ) { $ subscriptionDescription -> setMessageCount ( ( string ) $ subscriptionDescriptionArray [ 'MessageCount' ] ) ; } if ( array_key_exists ( 'MaxDeliveryCount' , $ subscriptionDescriptionArray ) ) { $ subscriptionDescription -> setMaxDeliveryCount ( ( string ) $ subscriptionDescriptionArray [ 'MaxDeliveryCount' ] ) ; } if ( array_key_exists ( 'EnableBatchedOperations' , $ subscriptionDescriptionArray ) ) { $ subscriptionDescription -> setEnableBatchedOperations ( ( bool ) $ subscriptionDescriptionArray [ 'EnableBatchedOperations' ] ) ; } return $ subscriptionDescription ; }
Creates a subscription description with specified XML string.

@param string $subscriptionDescriptionXml An XML based subscription
description

@return SubscriptionDescription
Creates a subscription description with specified XML string .