@@ -1,21 +1,21 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once __DIR__ . '/../vendor/autoload.php'; |
|
3 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
4 | 4 | |
5 | 5 | $record_id = '436dcb0b-14a9-c0d4-3046-5706b186b9b8'; |
6 | 6 | |
7 | -try{ |
|
8 | - $SugarAPI = new \SugarAPI\SDK\SugarAPI('instances.this/Pro/7621/',array('username' => 'admin','password'=>'asdf')); |
|
7 | +try { |
|
8 | + $SugarAPI = new \SugarAPI\SDK\SugarAPI('instances.this/Pro/7621/', array('username' => 'admin', 'password'=>'asdf')); |
|
9 | 9 | $SugarAPI->login(); |
10 | - $EP = $SugarAPI->updateRecord('Accounts',$record_id); |
|
10 | + $EP = $SugarAPI->updateRecord('Accounts', $record_id); |
|
11 | 11 | $EP->getRequest()->setOption(); |
12 | - $record = $SugarAPI->updateRecord('Accounts',$record_id)->data(array( |
|
12 | + $record = $SugarAPI->updateRecord('Accounts', $record_id)->data(array( |
|
13 | 13 | 'name' => 'Test Record 5', |
14 | 14 | 'email1' => '[email protected]' |
15 | 15 | ))->execute()->getResponse()->getBody(); |
16 | 16 | echo "Updated Record: ".$record->id; |
17 | 17 | |
18 | -}catch(\SugarAPI\SDK\Exception\AuthenticationError $ex){ |
|
18 | +}catch (\SugarAPI\SDK\Exception\AuthenticationError $ex) { |
|
19 | 19 | print $ex->getMessage(); |
20 | 20 | } |
21 | 21 |
@@ -15,7 +15,7 @@ |
||
15 | 15 | ))->execute()->getResponse()->getBody(); |
16 | 16 | echo "Updated Record: ".$record->id; |
17 | 17 | |
18 | -}catch(\SugarAPI\SDK\Exception\AuthenticationError $ex){ |
|
18 | +} catch(\SugarAPI\SDK\Exception\AuthenticationError $ex){ |
|
19 | 19 | print $ex->getMessage(); |
20 | 20 | } |
21 | 21 |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -require_once __DIR__ . '/../vendor/autoload.php'; |
|
3 | +require_once __DIR__.'/../vendor/autoload.php'; |
|
4 | 4 | |
5 | -try{ |
|
6 | - $SugarAPI = new \SugarAPI\SDK\SugarAPI('instances.this/Pro/7621/',array('username' => 'admin','password'=>'asdf')); |
|
5 | +try { |
|
6 | + $SugarAPI = new \SugarAPI\SDK\SugarAPI('instances.this/Pro/7621/', array('username' => 'admin', 'password'=>'asdf')); |
|
7 | 7 | $SugarAPI->login(); |
8 | 8 | $EP = $SugarAPI->createRecord('Accounts'); |
9 | 9 | $EP->data(array( |
@@ -11,14 +11,14 @@ discard block |
||
11 | 11 | 'email1' => '[email protected]' |
12 | 12 | )); |
13 | 13 | $response = $EP->execute()->getResponse(); |
14 | - if ($response->getStatus()=='200'){ |
|
14 | + if ($response->getStatus()=='200') { |
|
15 | 15 | $record = $response->getBody(); |
16 | - $EP2 = $SugarAPI->getRecord('Accounts',$record->id)->data(array('fields' => 'name,email1')); |
|
16 | + $EP2 = $SugarAPI->getRecord('Accounts', $record->id)->data(array('fields' => 'name,email1')); |
|
17 | 17 | $getResponse = $EP2->execute()->getResponse(); |
18 | 18 | print $EP2->getUrl(); |
19 | 19 | print_r($getResponse->getBody()); |
20 | 20 | } |
21 | 21 | |
22 | -}catch(\SugarAPI\SDK\Exception\AuthenticationError $ex){ |
|
22 | +}catch (\SugarAPI\SDK\Exception\AuthenticationError $ex) { |
|
23 | 23 | print $ex->getMessage(); |
24 | 24 | } |
25 | 25 | \ No newline at end of file |
@@ -19,6 +19,6 @@ |
||
19 | 19 | print_r($getResponse->getBody()); |
20 | 20 | } |
21 | 21 | |
22 | -}catch(\SugarAPI\SDK\Exception\AuthenticationError $ex){ |
|
22 | +} catch(\SugarAPI\SDK\Exception\AuthenticationError $ex){ |
|
23 | 23 | print $ex->getMessage(); |
24 | 24 | } |
25 | 25 | \ No newline at end of file |