Completed
Push — 2.0 ( da6ae8...19a05a )
by Raphaël
04:15 queued 02:01
created
src/ZohoDatabasePusher.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
             $this->logger = $logger;
47 47
         }
48 48
         $this->apiLimitInsertUpdateDelete = $apiLimitInsertUpdateDelete;
49
-        if($apiLimitInsertUpdateDelete === null){
49
+        if ($apiLimitInsertUpdateDelete === null) {
50 50
             $this->apiLimitInsertUpdateDelete = 100;
51 51
         }
52 52
     }
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
             $statement->addSelect('l.field_name as updated_fieldname');
99 99
         }
100 100
         $statement->from($localTable, 'l')
101
-            ->join('l','('.$statementLimiter->getSQL().')','ll','ll.table_name = l.table_name and  ll.uid = l.uid')
101
+            ->join('l', '('.$statementLimiter->getSQL().')', 'll', 'll.table_name = l.table_name and  ll.uid = l.uid')
102 102
             ->join('l', $tableName, 'zcrm', 'zcrm.uid = l.uid')
103 103
             ->where('l.table_name=:table_name')
104 104
             ->setParameters([
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
                 $rowsDeleted[] = $row['uid'];
131 131
             }
132 132
         }
133
-        $this->sendDataToZohoCleanLocal($zohoDao,$zohoBeans,$rowsDeleted,$update);
133
+        $this->sendDataToZohoCleanLocal($zohoDao, $zohoBeans, $rowsDeleted, $update);
134 134
     }
135 135
 
136 136
     /**
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
      * @param string[] $rowsDeleted
140 140
      * @param bool $update
141 141
      */
142
-    private function sendDataToZohoCleanLocal(AbstractZohoDao $zohoDao, array $zohoBeans,$rowsDeleted, $update = false)
142
+    private function sendDataToZohoCleanLocal(AbstractZohoDao $zohoDao, array $zohoBeans, $rowsDeleted, $update = false)
143 143
     {
144 144
         $tableName = ZohoDatabaseHelper::getTableName($zohoDao, $this->prefix);
145 145
         $zohoDao->save($zohoBeans);
@@ -151,13 +151,13 @@  discard block
 block discarded – undo
151 151
                     // ID not exist we can update the new row with the Zoho ID
152 152
                     $this->connection->beginTransaction();
153 153
                     $this->connection->update($tableName, ['id' => $zohoBean->getZohoId()], ['uid' => $uid]);
154
-                    $this->connection->delete('local_insert', ['table_name'=>$tableName, 'uid' => $uid ]);
154
+                    $this->connection->delete('local_insert', ['table_name'=>$tableName, 'uid' => $uid]);
155 155
                     $this->connection->commit();
156 156
                 } else {
157 157
                     //ID already exist we need to delete the duplicate row.
158 158
                     $this->connection->beginTransaction();
159
-                    $this->connection->delete($tableName, ['uid' => $uid ]);
160
-                    $this->connection->delete('local_insert', ['table_name'=>$tableName, 'uid' => $uid ]);
159
+                    $this->connection->delete($tableName, ['uid' => $uid]);
160
+                    $this->connection->delete('local_insert', ['table_name'=>$tableName, 'uid' => $uid]);
161 161
                     $this->connection->commit();
162 162
                 }
163 163
             }
Please login to merge, or discard this patch.