@@ 306-317 (lines=12) @@ | ||
303 | { |
|
304 | foreach ($row as $columnName => $columnValue) { |
|
305 | $fieldMethod = $dao->getFieldFromFieldName($columnName); |
|
306 | if (!in_array($columnName, EntitiesGeneratorService::$defaultDateFields) && $fieldMethod |
|
307 | && (!in_array($columnName, ['id', 'uid'])) && !is_null($columnValue) |
|
308 | ) { |
|
309 | // Changing only Name doesn't work properly on Zoho |
|
310 | if ($this->endsWith($columnName, '_OwnerName') || $this->endsWith($columnName, '_Name')) { |
|
311 | continue; |
|
312 | } |
|
313 | $type = $fieldMethod->getType(); |
|
314 | $value = $this->formatValueToBeans($type, $columnValue); |
|
315 | $setterMethod = $fieldMethod->getSetter(); |
|
316 | $zohoBean->{$setterMethod}($value); |
|
317 | } |
|
318 | } |
|
319 | } |
|
320 | ||
@@ 332-343 (lines=12) @@ | ||
329 | private function updateDataZohoBean(AbstractZohoDao $dao, ZohoBeanInterface $zohoBean, $columnName, $valueDb) |
|
330 | { |
|
331 | $fieldMethod = $dao->getFieldFromFieldName($columnName); |
|
332 | if (!in_array($columnName, EntitiesGeneratorService::$defaultDateFields) && $fieldMethod |
|
333 | && !in_array($columnName, ['id', 'uid']) |
|
334 | ) { |
|
335 | // Changing only Name doesn't work properly on Zoho |
|
336 | if ($this->endsWith($columnName, '_OwnerName') || $this->endsWith($columnName, '_Name')) { |
|
337 | return; |
|
338 | } |
|
339 | $type = $fieldMethod->getType(); |
|
340 | $value = is_null($valueDb) ? $valueDb : $this->formatValueToBeans($type, $valueDb); |
|
341 | $setterMethod = $fieldMethod->getSetter(); |
|
342 | $zohoBean->{$setterMethod}($value); |
|
343 | } |
|
344 | } |
|
345 | ||
346 | /** |