cwmiller / broadworks-connector

Simple library for connecting to BroadWorks OCI-P API
MIT License
8 stars 5 forks source link

Function? #7

Closed TwinMist closed 6 years ago

TwinMist commented 6 years ago

Just wondering if all this could be built into a nice function ie $request = GetRequest('UserGetRequest','user_1@domain.com'); then if would return all the details.

i know if would be different for add and modify.

just a idea thanks

TwinMist commented 6 years ago

is this the best way to code a function? many thanks

$ocip = new OcipClient(URL, OCI_USER, OCI_PASS); function UserGetRequest($userid) { global $ocip; $request = (new UserGetRequest20()) ->setuserId($userid); $response = $ocip->call($request);

if ($response instanceof ErrorResponse) {
   return $response->getSummary();
} else {
    return $response;
}

}