## Broadworks_OCIP\core\Builder\Builder

The Builder's purpose is to generate an XML payload Broadworks understands from the data passed in. Typically a ComplexType object (more on these later) would be passed into the Builder but raw XML can be passed in too. Raw XML would be passed in so it can be wrapped in a Broadsoft envelope with a valid session id.

#### UserAddRequest17sp4 example

    <?php
    require_once 'Broadworks_OCIP/common.php';

    use Broadworks_OCIP\api\Rel_17_sp4_1_197_OCISchemaAS\OCISchemaUser\UserAddRequest17sp4;
    use Broadworks_OCIP\core\Builder\Builder;

    $request = new UserAddRequest17sp4();
    $request->setUserId('user@example.com');
    $request->setEmailAddress('donotreply@example.com');
    $request->setPassword(uniqid());

    echo Builder::buildComplex($request);

    <UserAddRequest17sp4>
        <userId>user@example.com</userId>
        <password>55078c4211943</password>
        <emailAddress>donotreply@example.com</emailAddress>
    </UserAddRequest17sp4>

GitHub « Previous Next »