Completed
Push — master ( 4b39ca...09a82c )
by Mike
04:47 queued 02:20
created
examples/CRUD.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,22 +1,22 @@
 block discarded – undo
1 1
 <?php
2 2
 
3 3
 
4
-require_once __DIR__ . '/../vendor/autoload.php';
4
+require_once __DIR__.'/../vendor/autoload.php';
5 5
 
6 6
 try{
7
-    $SugarAPI = new \SugarAPI\SDK\SugarAPI('instances.this/Pro/7700/',array('username' => 'admin','password'=>'asdf'));
7
+    $SugarAPI = new \SugarAPI\SDK\SugarAPI('instances.this/Pro/7700/', array('username' => 'admin', 'password'=>'asdf'));
8 8
     $SugarAPI->login();
9 9
     $EP = $SugarAPI->filterRecords('Accounts');
10 10
     $response = $EP->execute()->getResponse();
11 11
     if ($response->getStatus()=='200'){
12 12
         $recordList = $response->getBody();
13
-        $max=count($recordList->records);
13
+        $max = count($recordList->records);
14 14
         echo "found $max records from Filter Records request. <br>";
15
-        $number = rand(0,$max);
15
+        $number = rand(0, $max);
16 16
         $randomRecord = $recordList->records[$number];
17 17
         echo "Choose random record #$number, with ID: ".$randomRecord->id." <br>";
18 18
 
19
-        $getRecord = $SugarAPI->getRecord('Accounts',$randomRecord->id)->data(array(
19
+        $getRecord = $SugarAPI->getRecord('Accounts', $randomRecord->id)->data(array(
20 20
             'fields' => 'name'
21 21
         ))->execute();
22 22
         $response = $getRecord->getResponse();
Please login to merge, or discard this patch.
src/SugarAPI.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -98,7 +98,7 @@
 block discarded – undo
98 98
         $response = $EP->data($this->authOptions)->execute()->getResponse();
99 99
         if ($response->getStatus()=='200'){
100 100
             $this->authToken = $response->getBody();
101
-        } else{
101
+        }else{
102 102
             throw new AuthenticationException($response->getBody());
103 103
         }
104 104
     }
Please login to merge, or discard this patch.