@@ -1,18 +1,18 @@ |
||
| 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 = 'a887c75b-b89a-852e-8e67-56f1ccdee355'; |
| 6 | 6 | |
| 7 | -try{ |
|
| 8 | - $SugarAPI = new \SugarAPI\SDK\SugarAPI('localhost/ent77',array('username' => 'admin','password'=>'admin123')); |
|
| 7 | +try { |
|
| 8 | + $SugarAPI = new \SugarAPI\SDK\SugarAPI('localhost/ent77', array('username' => 'admin', 'password'=>'admin123')); |
|
| 9 | 9 | $SugarAPI->login(); |
| 10 | - $EP = $SugarAPI->favorite('Accounts',$record_id); |
|
| 10 | + $EP = $SugarAPI->favorite('Accounts', $record_id); |
|
| 11 | 11 | $response = $EP->execute()->getResponse()->getBody(); |
| 12 | 12 | |
| 13 | 13 | print_r($response); |
| 14 | 14 | |
| 15 | -}catch(\SugarAPI\SDK\Exception\AuthenticationError $ex){ |
|
| 15 | +}catch (\SugarAPI\SDK\Exception\AuthenticationError $ex) { |
|
| 16 | 16 | print $ex->getMessage(); |
| 17 | 17 | } |
| 18 | 18 | |
@@ -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 | |