updatephone - How to define more than one line?

Version 1
    This document was generated from CDN thread

    Created by: Alex Arwine on 15-10-2008 10:02:47 PM
    While starting to write some PHP to utilize the updatePhone, I ran into a problem to which I have no solution to.
    How would I tell it to have two lines?
    Here's what I have so far, with lineidentifier incomplete.

    $updatePhone->name = "SEP00181916706E";
    $updatePhone->newName = "SEP00181916706E";
    $updatePhone->description = "Alex Arwine";
    $updatePhone->callingSearchSpaceName = "LosAngeles-USA";
    $updatePhone->devicePoolName = "SP_DP";
    $updatePhone->locationName = "Los Angeles";
    $updatePhone->mediaResourceListName = "Los Angeles Office";
    $updatePhone->lines->lineIdentifier->directoryNumber=
    $updatePhone->phoneTemplateName = "2-Line 7940";
    $updatePhone->userLocale = "English, United States";
    $updatePhone->networkLocale = "United States";
    $updatePhone->softkeyTemplateName = "Standard user";

    Ideas?
    Thanks in advanced,
    -alex

    Subject: Re: updatephone - How to define more than one line?
    Replied by: David Staudt on 16-10-2008 01:10:38 AM
    updatePhone/lines is a collection of line appearance instances. Not sure what language you're using and how the collection would be handled, but the output of the XML should have something like this

    ...
    <lines>
    <line>
    <lineIdentifier>
    <directoryNumber>1000</directoryNumber>
    <routePartitionName>Default</routePartitionName>
    </lineIdentifier>
    </line>
    <line>
    <lineIdentifier>
    <directoryNumber>1001</directoryNumber>
    <routePartitionName>Default</routePartitionName>
    </lineIdentifier>
    </line>
    </lines>
    ...

    Note that the lines collection you submit fully replaces what is on the phone. If the phone has an existing line and you want to add an additional line, you will first needs to retrieve the existing line(s) via getPhone, then submit updatePhone with the updated <lines> collection. If you just do updatePhone with one line, any other existing lines will be removed and replaced with your single line.