private static function _batchUpdateHelper(Api\MtBatchSmsUpdate $batch)
    {
        $fields = [];

        if (!empty($batch->getRecipientInsertions())) {
            $fields['to_add'] = $batch->getRecipientInsertions();
        }

        if (!empty($batch->getRecipientRemovals())) {
            $fields['to_remove'] = $batch->getRecipientRemovals();
        }

        if (null != $batch->getSender()) {
            $fields['from'] = $batch->getSender();
        }

        if (null != $batch->getDeliveryReport()) {
            if ($batch->getDeliveryReport() === Api\Reset::reset()) {
                $fields['delivery_report'] = null;
            } else {
                $fields['delivery_report'] = $batch->getDeliveryReport();
            }
        }

        if (null != $batch->getSendAt()) {
            if ($batch->getSendAt() === Api\Reset::reset()) {
                $fields['send_at'] = null;
            } else {
                $fields['send_at'] = Serialize::_dateTime($batch->getSendAt());
            }
        }

        if (null != $batch->getExpireAt()) {
            if ($batch->getExpireAt() === Api\Reset::reset()) {
                $fields['expire_at'] = null;
            } else {
                $fields['expire_at']
                    = Serialize::_dateTime($batch->getExpireAt());
            }
        }

        if (null != $batch->getCallbackUrl()) {
            if ($batch->getCallbackUrl() === Api\Reset::reset()) {
                $fields['callback_url'] = null;
            } else {
                $fields['callback_url'] = $batch->getCallbackUrl();
            }
        }

        return $fields;
    }
private static function _batchUpdateHelper(Api\MtBatchSmsUpdate $batch)
    {
        $fields = [];

        if (!empty($batch->getRecipientInsertions())) {
            $fields['to_add'] = $batch->getRecipientInsertions();
        }

        if (!empty($batch->getRecipientRemovals())) {
            $fields['to_remove'] = $batch->getRecipientRemovals();
        }

        if (null != $batch->getSender()) {
            $fields['from'] = $batch->getSender();
        }

        if (null != $batch->getDeliveryReport()) {
            if ($batch->getDeliveryReport() === Api\Reset::reset()) {
                $fields['delivery_report'] = null;
            } else {
                $fields['delivery_report'] = $batch->getDeliveryReport();
            }
        }

        if (null != $batch->getSendAt()) {
            if ($batch->getSendAt() === Api\Reset::reset()) {
                $fields['send_at'] = null;
            } else {
                $fields['send_at'] = Serialize::_dateTime($batch->getSendAt());
            }
        }

        if (null != $batch->getExpireAt()) {
            if ($batch->getExpireAt() === Api\Reset::reset()) {
                $fields['expire_at'] = null;
            } else {
                $fields['expire_at']
                    = Serialize::_dateTime($batch->getExpireAt());
            }
        }

        if (null != $batch->getCallbackUrl()) {
            if ($batch->getCallbackUrl() === Api\Reset::reset()) {
                $fields['callback_url'] = null;
            } else {
                $fields['callback_url'] = $batch->getCallbackUrl();
            }
        }

        return $fields;
    }
private static function _batchUpdateHelper ( Api \ MtBatchSmsUpdate $ batch ) { $ fields = [ ] ; if ( ! empty ( $ batch -> getRecipientInsertions ( ) ) ) { $ fields [ 'to_add' ] = $ batch -> getRecipientInsertions ( ) ; } if ( ! empty ( $ batch -> getRecipientRemovals ( ) ) ) { $ fields [ 'to_remove' ] = $ batch -> getRecipientRemovals ( ) ; } if ( null != $ batch -> getSender ( ) ) { $ fields [ 'from' ] = $ batch -> getSender ( ) ; } if ( null != $ batch -> getDeliveryReport ( ) ) { if ( $ batch -> getDeliveryReport ( ) === Api \ Reset :: reset ( ) ) { $ fields [ 'delivery_report' ] = null ; } else { $ fields [ 'delivery_report' ] = $ batch -> getDeliveryReport ( ) ; } } if ( null != $ batch -> getSendAt ( ) ) { if ( $ batch -> getSendAt ( ) === Api \ Reset :: reset ( ) ) { $ fields [ 'send_at' ] = null ; } else { $ fields [ 'send_at' ] = Serialize :: _dateTime ( $ batch -> getSendAt ( ) ) ; } } if ( null != $ batch -> getExpireAt ( ) ) { if ( $ batch -> getExpireAt ( ) === Api \ Reset :: reset ( ) ) { $ fields [ 'expire_at' ] = null ; } else { $ fields [ 'expire_at' ] = Serialize :: _dateTime ( $ batch -> getExpireAt ( ) ) ; } } if ( null != $ batch -> getCallbackUrl ( ) ) { if ( $ batch -> getCallbackUrl ( ) === Api \ Reset :: reset ( ) ) { $ fields [ 'callback_url' ] = null ; } else { $ fields [ 'callback_url' ] = $ batch -> getCallbackUrl ( ) ; } } return $ fields ; }
Helper that prepares the given batch for serialization

@param Api\MtBatchSmsUpdate $batch the batch to serialize

@return [] associative array suitable for JSON serialization
Helper that prepares the given batch for serialization