@@ -16,6 +16,7 @@ |
||
| 16 | 16 | * Computes the name of the table based on the DAO plural module name. |
| 17 | 17 | * |
| 18 | 18 | * @param AbstractZohoDao $dao |
| 19 | + * @param string $prefix |
|
| 19 | 20 | * |
| 20 | 21 | * @return string |
| 21 | 22 | */ |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | $localDelete = $schema->createTable('local_delete'); |
| 50 | 50 | $localDelete->addColumn('table_name', 'string', ['length' => 100]); |
| 51 | 51 | $localDelete->addColumn('uid', 'integer'); |
| 52 | - $localDelete->addColumn('id', 'string', ['length' => 100]); |
|
| 52 | + $localDelete->addColumn('id', 'string', ['length' => 100]); |
|
| 53 | 53 | $localDelete->setPrimaryKey(array('table_name', 'uid')); |
| 54 | 54 | $localDelete->addUniqueIndex(['id', 'table_name']); |
| 55 | 55 | |
@@ -126,7 +126,6 @@ |
||
| 126 | 126 | |
| 127 | 127 | /** |
| 128 | 128 | * Run he sync Db command. |
| 129 | - * @param InputInterface $input |
|
| 130 | 129 | * @param OutputInterface $output |
| 131 | 130 | */ |
| 132 | 131 | private function syncDb(OutputInterface $output){ |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | $this->zohoDatabaseModelSync = $zohoDatabaseModelSync; |
| 87 | 87 | $this->zohoDatabaseCopier = $zohoDatabaseCopier; |
| 88 | 88 | $this->zohoDatabaseSync = $zohoDatabaseSync; |
| 89 | - $this->zohoEntitiesGenerator = $zohoEntitiesGenerator; |
|
| 89 | + $this->zohoEntitiesGenerator = $zohoEntitiesGenerator; |
|
| 90 | 90 | $this->zohoClient = $zohoClient; |
| 91 | 91 | $this->pathZohoDaos = $pathZohoDaos; |
| 92 | 92 | $this->namespaceZohoDaos = $namespaceZohoDaos; |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | private function getListFieldName(AbstractZohoDao $zohoDao) |
| 161 | 161 | { |
| 162 | - $fieldNames= array(); |
|
| 162 | + $fieldNames = array(); |
|
| 163 | 163 | foreach ($zohoDao->getFields() as $fieldsDescriptor) { |
| 164 | 164 | foreach (array_values($fieldsDescriptor) as $fieldDescriptor) { |
| 165 | 165 | $fieldNames[] = $fieldDescriptor['name']; |
@@ -177,11 +177,11 @@ discard block |
||
| 177 | 177 | private function regenerateZohoDao(OutputInterface $output) |
| 178 | 178 | { |
| 179 | 179 | $output->writeln("Start to generate all the zoho daos."); |
| 180 | - $zohoModules = $this->zohoEntitiesGenerator->generateAll($this->pathZohoDaos,$this->namespaceZohoDaos); |
|
| 180 | + $zohoModules = $this->zohoEntitiesGenerator->generateAll($this->pathZohoDaos, $this->namespaceZohoDaos); |
|
| 181 | 181 | foreach ($zohoModules as $daoFullClassName) { |
| 182 | 182 | /* @var $zohoDao AbstractZohoDao */ |
| 183 | 183 | $zohoDao = new $daoFullClassName($this->zohoClient); |
| 184 | - if(!in_array('lastActivityTime', $this->getListFieldName($zohoDao))){ |
|
| 184 | + if (!in_array('lastActivityTime', $this->getListFieldName($zohoDao))) { |
|
| 185 | 185 | continue; |
| 186 | 186 | } |
| 187 | 187 | $this->zohoDaos [] = $zohoDao; |
@@ -118,7 +118,7 @@ |
||
| 118 | 118 | foreach ($zohoBeans as $uid => $zohoBean) { |
| 119 | 119 | $this->connection->beginTransaction(); |
| 120 | 120 | $this->connection->update($tableName, ['id' => $zohoBean->getZohoId()], ['uid' => $uid]); |
| 121 | - $this->connection->delete('local_insert', ['table_name'=>$tableName, 'uid' => $uid ]); |
|
| 121 | + $this->connection->delete('local_insert', ['table_name'=>$tableName, 'uid' => $uid]); |
|
| 122 | 122 | $this->connection->commit(); |
| 123 | 123 | } |
| 124 | 124 | } else { |
@@ -80,7 +80,7 @@ |
||
| 80 | 80 | |
| 81 | 81 | $flatFields = ZohoDatabaseHelper::getFlatFields($dao->getFields()); |
| 82 | 82 | $table->addColumn('uid', 'integer', ['autoincrement' => true]); |
| 83 | - $table->addColumn('id', 'string', ['length' => 100,'notnull'=>false]); |
|
| 83 | + $table->addColumn('id', 'string', ['length' => 100, 'notnull'=>false]); |
|
| 84 | 84 | $table->addUniqueIndex(['id']); |
| 85 | 85 | $table->setPrimaryKey(['uid']); |
| 86 | 86 | |