@@ -7,7 +7,6 @@ |
||
| 7 | 7 | use Psr\Log\LoggerInterface; |
| 8 | 8 | use Psr\Log\NullLogger; |
| 9 | 9 | use Wabel\Zoho\CRM\AbstractZohoDao; |
| 10 | -use Wabel\Zoho\CRM\Request\Response; |
|
| 11 | 10 | use zcrmsdk\crm\setup\users\ZCRMUser; |
| 12 | 11 | |
| 13 | 12 | /** |
@@ -86,15 +86,15 @@ discard block |
||
| 86 | 86 | $table = $schema->createTable($tableName); |
| 87 | 87 | |
| 88 | 88 | //@Temporary fix to use Mysql5.7 not strict |
| 89 | - $table->addColumn('uid', 'string', ['length' => 36,'notnull'=>false]); |
|
| 90 | - $table->addColumn('id', 'string', ['length' => 100,'notnull'=>false]); |
|
| 89 | + $table->addColumn('uid', 'string', ['length' => 36, 'notnull'=>false]); |
|
| 90 | + $table->addColumn('id', 'string', ['length' => 100, 'notnull'=>false]); |
|
| 91 | 91 | $table->addUniqueIndex(['id']); |
| 92 | 92 | $table->setPrimaryKey(['uid']); |
| 93 | 93 | |
| 94 | 94 | foreach ($dao->getFields() as $field) { |
| 95 | 95 | $columnName = $field->getName(); |
| 96 | 96 | //It seems sometime we can have the same field twice in the list of fields from the API. |
| 97 | - if($table->hasColumn($columnName)) { |
|
| 97 | + if ($table->hasColumn($columnName)) { |
|
| 98 | 98 | continue; |
| 99 | 99 | } |
| 100 | 100 | |
@@ -105,23 +105,23 @@ discard block |
||
| 105 | 105 | switch ($field->getType()) { |
| 106 | 106 | case 'fileupload': |
| 107 | 107 | $type = 'string'; |
| 108 | - $length = $field->getMaxlength() && $field->getMaxlength() > 0?$field->getMaxlength() : 255; |
|
| 108 | + $length = $field->getMaxlength() && $field->getMaxlength() > 0 ? $field->getMaxlength() : 255; |
|
| 109 | 109 | break; |
| 110 | 110 | case 'lookup': |
| 111 | 111 | $type = 'string'; |
| 112 | - $length = $field->getMaxlength() && $field->getMaxlength() > 0?$field->getMaxlength() : 100; |
|
| 112 | + $length = $field->getMaxlength() && $field->getMaxlength() > 0 ? $field->getMaxlength() : 100; |
|
| 113 | 113 | $index = true; |
| 114 | 114 | break; |
| 115 | 115 | case 'userlookup': |
| 116 | 116 | case 'ownerlookup': |
| 117 | 117 | $type = 'string'; |
| 118 | 118 | $index = true; |
| 119 | - $length = $field->getMaxlength() && $field->getMaxlength() > 0?$field->getMaxlength() : 25; |
|
| 119 | + $length = $field->getMaxlength() && $field->getMaxlength() > 0 ? $field->getMaxlength() : 25; |
|
| 120 | 120 | break; |
| 121 | 121 | case 'formula': |
| 122 | 122 | // Note: a Formula can return any type, but we have no way to know which type it returns... |
| 123 | 123 | $type = 'string'; |
| 124 | - $length = $field->getMaxlength() && $field->getMaxlength() > 0?$field->getMaxlength() : 100; |
|
| 124 | + $length = $field->getMaxlength() && $field->getMaxlength() > 0 ? $field->getMaxlength() : 100; |
|
| 125 | 125 | break; |
| 126 | 126 | case 'datetime': |
| 127 | 127 | $type = 'datetime'; |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | case 'picklist': |
| 146 | 146 | case 'website': |
| 147 | 147 | $type = 'string'; |
| 148 | - $length = $field->getMaxlength() && $field->getMaxlength() > 0?$field->getMaxlength() : 255; |
|
| 148 | + $length = $field->getMaxlength() && $field->getMaxlength() > 0 ? $field->getMaxlength() : 255; |
|
| 149 | 149 | break; |
| 150 | 150 | case 'multiselectlookup': |
| 151 | 151 | case 'multiuserlookup': |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | case 'autonumber': |
| 162 | 162 | case 'integer': |
| 163 | 163 | $type = 'integer'; |
| 164 | - $length = $field->getMaxlength() && $field->getMaxlength() > 0?$field->getMaxlength() : 255; |
|
| 164 | + $length = $field->getMaxlength() && $field->getMaxlength() > 0 ? $field->getMaxlength() : 255; |
|
| 165 | 165 | break; |
| 166 | 166 | case 'currency': |
| 167 | 167 | case 'decimal': |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $schema = new Schema(); |
| 214 | 214 | $table = $schema->createTable($tableName); |
| 215 | 215 | |
| 216 | - $table->addColumn('id', 'string', ['length' => 100,'notnull'=>false]); |
|
| 216 | + $table->addColumn('id', 'string', ['length' => 100, 'notnull'=>false]); |
|
| 217 | 217 | $table->setPrimaryKey(['id']); |
| 218 | 218 | foreach (ZCRMUser::$defaultKeys as $field) { |
| 219 | 219 | if ($field === 'id') { |